<html>
<head>
<meta charset="utf-8"/>
<meta
     name="viewport"
     content="
             initial-scale=1,
             maximum-scale=1,
             minimum-scale=1,
             user-scalable=no"
    />
<script language="javascript" src="_js/jquery.min.js"></script>
<script language="javascript" src="_js/jiqi.js"></script>
<script language="javascript" src="_js/purple_star.js"></script>

<script language="JavaScript">
function luiyin_720(day,i) {
  "use strict";
  var t720 = {"\u5e9a\u5b50": ["\u8fb0\u7533\u5b50-\u5143", "\u5df3\u620c\u536f-\u91cd", "\u5bc5\u7533\u5bc5-\u8fd4", "\u620c\u5df3\u5b50-\u6bd4", "\u5b50\u7533\u8fb0-\u91cd", "\u5348\u536f\u5b50-\u77e5", "\u5348\u8fb0\u5bc5-\u6d89", "\u620c\u9149\u7533-\u5143", "\u7533\u5bc5\u5df3-\u4f0f", "\u5bc5\u536f\u8fb0-\u77e5", "\u8fb0\u5348\u7533-\u6d89", "\u5348\u9149\u5b50-\u9065"], "\u4e59\u4ea5": ["\u672a\u536f\u4ea5-\u6d89", "\u4e11\u620c\u672a-\u91cd", "\u9149\u672a\u5df3-\u9065", "\u620c\u9149\u7533-\u5143", "\u8fb0\u4ea5\u5df3-\u4f0f", "\u4e11\u5bc5\u536f-\u5143", "\u7533\u620c\u5b50-\u91cd", "\u672a\u620c\u4e11-\u91cd", "\u672a\u4ea5\u536f-\u91cd", "\u5bc5\u672a\u5b50-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u5348\u4e11\u7533-\u91cd"], "\u4e59\u672a": ["\u536f\u4ea5\u672a-\u5143", "\u4e11\u620c\u672a-\u91cd", "\u4ea5\u5bc5\u5df3-\u6634", "\u620c\u536f\u5348-\u6634", "\u8fb0\u672a\u4e11-\u4f0f", "\u9149\u620c\u4ea5-\u9065", "\u7533\u620c\u5b50-\u91cd", "\u672a\u620c\u4e11-\u91cd", "\u4ea5\u536f\u672a-\u91cd", "\u5df3\u620c\u536f-\u6bd4", "\u620c\u8fb0\u620c-\u8fd4", "\u5348\u4e11\u7533-\u91cd"], "\u7532\u7533": ["\u5348\u8fb0\u5bc5-\u6d89", "\u5b50\u4ea5\u620c-\u77e5", "\u5bc5\u5df3\u7533-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u6d89", "\u7533\u4ea5\u5bc5-\u91cd", "\u8fb0\u7533\u5b50-\u5143", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4", "\u620c\u5df3\u5b50-\u77e5", "\u5b50\u7533\u8fb0-\u6d89", "\u5df3\u5bc5\u4ea5-\u5143"], "\u4e19\u5b50": ["\u5b50\u672a\u5bc5-\u6d89", "\u7533\u8fb0\u5b50-\u9065", "\u5348\u536f\u5b50-\u5143", "\u4e11\u4ea5\u9149-\u91cd", "\u620c\u9149\u7533-\u77e5", "\u5df3\u7533\u5bc5-\u4f0f", "\u5bc5\u536f\u8fb0-\u77e5", "\u8fb0\u5348\u7533-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u91cd", "\u5df3\u620c\u536f-\u91cd", "\u5348\u5b50\u5348-\u8fd4"], "\u4e19\u5bc5": ["\u5b50\u672a\u5bc5-\u77e5", "\u620c\u5348\u5bc5-\u91cd", "\u4ea5\u5df3\u7533-\u9065", "\u4e11\u4ea5\u9149-\u91cd", "\u5b50\u4ea5\u620c-\u6bd4", "\u5df3\u7533\u5bc5-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u91cd", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4"], "\u8f9b\u4e11": ["\u536f\u5df3\u672a-\u5143", "\u5df3\u4e11\u4e11-\u522b", "\u9149\u4e11\u5df3-\u6bd4", "\u536f\u7533\u4e11-\u91cd", "\u4ea5\u672a\u8fb0-\u8fd4", "\u536f\u620c\u5df3-\u91cd", "\u5df3\u4e11\u9149-\u77e5", "\u5df3\u672a\u672a-\u522b", "\u4ea5\u9149\u672a-\u91cd", "\u5b50\u4ea5\u620c-\u91cd", "\u4e11\u620c\u672a-\u4f0f", "\u5bc5\u536f\u8fb0-\u5143"], "\u5e9a\u620c": ["\u8fb0\u7533\u5b50-\u6d89", "\u7533\u4e11\u5348-\u77e5", "\u5bc5\u7533\u5bc5-\u8fd4", "\u620c\u5df3\u5b50-\u6bd4", "\u5b50\u7533\u8fb0-\u91cd", "\u5df3\u5bc5\u4ea5-\u5143", "\u5348\u8fb0\u5bc5-\u5143", "\u5348\u5df3\u8fb0-\u9065", "\u7533\u5bc5\u5df3-\u4f0f", "\u4ea5\u5b50\u4e11-\u91cd", "\u5b50\u5bc5\u8fb0-\u91cd", "\u5bc5\u5df3\u7533-\u9065"], "\u4e01\u4e11": ["\u5df3\u620c\u536f-\u91cd", "\u4ea5\u672a\u4e11-\u8fd4", "\u536f\u620c\u5df3-\u91cd", "\u5df3\u4e11\u9149-\u5143", "\u5b50\u8fb0\u620c-\u6634", "\u4ea5\u9149\u672a-\u91cd", "\u5b50\u4ea5\u620c-\u91cd", "\u4e11\u620c\u672a-\u4f0f", "\u7533\u9149\u620c-\u91cd", "\u9149\u4ea5\u4e11-\u91cd", "\u5348\u620c\u8fb0-\u6634", "\u9149\u4e11\u5df3-\u91cd"], "\u4e01\u9149": ["\u672a\u5b50\u5df3-\u6d89", "\u536f\u9149\u536f-\u8fd4", "\u4ea5\u5348\u4e11-\u91cd", "\u5df3\u4e11\u9149-\u5143", "\u5348\u536f\u5b50-\u5143", "\u4e11\u5df3\u5df3-\u522b", "\u7533\u672a\u5348-\u9065", "\u9149\u672a\u4e11-\u4f0f", "\u4ea5\u5b50\u4e11-\u6bd4", "\u9149\u4ea5\u4e11-\u91cd", "\u5b50\u536f\u5348-\u9065", "\u4ea5\u536f\u672a-\u5143"], "\u5df1\u536f": ["\u5df3\u620c\u536f-\u6bd4", "\u536f\u9149\u536f-\u8fd4", "\u620c\u5df3\u5b50-\u91cd", "\u672a\u536f\u4ea5-\u6d89", "\u5b50\u9149\u5348-\u9065", "\u4ea5\u9149\u672a-\u6d89", "\u4e11\u5b50\u4ea5-\u91cd", "\u536f\u5b50\u5348-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u4ea5\u4e11\u536f-\u9065", "\u9149\u5b50\u536f-\u91cd", "\u672a\u4ea5\u536f-\u6d89"], "\u7678\u4e11": ["\u5b50\u4ea5\u620c-\u91cd", "\u4e11\u620c\u672a-\u4f0f", "\u5bc5\u536f\u8fb0-\u5143", "\u536f\u5df3\u672a-\u5143", "\u8fb0\u672a\u620c-\u5143", "\u9149\u4e11\u5df3-\u6d89", "\u5348\u4ea5\u8fb0-\u91cd", "\u672a\u4e11\u672a-\u8fd4", "\u536f\u620c\u5df3-\u91cd", "\u5df3\u9149\u4e11-\u5143", "\u620c\u672a\u8fb0-\u5143", "\u4ea5\u9149\u672a-\u91cd"], "\u620a\u8fb0": ["\u5b50\u672a\u5bc5-\u6d89", "\u5b50\u7533\u8fb0-\u91cd", "\u5bc5\u4ea5\u7533-\u5143", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u5bc5\u5348\u5348-\u522b", "\u7533\u620c\u5b50-\u91cd", "\u4ea5\u5bc5\u5df3-\u9065", "\u5b50\u8fb0\u7533-\u9065", "\u5bc5\u536f\u5b50-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4"], "\u4e01\u672a": ["\u5df3\u620c\u536f-\u6bd4", "\u5df3\u4e11\u4e11-\u8fd4", "\u9149\u8fb0\u4ea5-\u77e5", "\u4ea5\u536f\u672a-\u5143", "\u4ea5\u8fb0\u8fb0-\u516b", "\u4e11\u5df3\u5df3-\u516b", "\u536f\u5348\u5348-\u516b", "\u672a\u4e11\u620c-\u4f0f", "\u7533\u9149\u620c-\u91cd", "\u9149\u4ea5\u4e11-\u91cd", "\u4ea5\u620c\u620c-\u516b", "\u4ea5\u536f\u672a-\u91cd"], "\u5df1\u5df3": ["\u5df3\u620c\u536f-\u6bd4", "\u5df3\u4ea5\u5df3-\u8fd4", "\u9149\u8fb0\u4ea5-\u6d89", "\u536f\u4ea5\u672a-\u5143", "\u5bc5\u4ea5\u7533-\u9065", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u7533\u7533\u5348-\u6634", "\u4ea5\u4e11\u536f-\u9065", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u6d89"], "\u5df1\u4e11": ["\u5df3\u620c\u536f-\u6bd4", "\u4ea5\u672a\u4e11-\u8fd4", "\u536f\u620c\u5df3-\u91cd", "\u5df3\u4e11\u9149-\u6d89", "\u5b50\u8fb0\u620c-\u6634", "\u4ea5\u9149\u672a-\u91cd", "\u5b50\u4ea5\u620c-\u91cd", "\u4e11\u620c\u672a-\u4f0f", "\u5bc5\u536f\u8fb0-\u5143", "\u536f\u5df3\u672a-\u5143", "\u5348\u620c\u8fb0-\u6634", "\u9149\u4e11\u5df3-\u6d89"], "\u58ec\u620c": ["\u4ea5\u5b50\u4e11-\u91cd", "\u5b50\u5bc5\u8fb0-\u91cd", "\u8fb0\u672a\u620c-\u9065", "\u672a\u4ea5\u536f-\u91cd", "\u8fb0\u9149\u5bc5-\u6d89", "\u5df3\u4ea5\u5df3-\u8fd4", "\u5348\u4e11\u7533-\u91cd", "\u672a\u536f\u4ea5-\u6d89", "\u5df3\u5bc5\u4ea5-\u5143", "\u5348\u8fb0\u5bc5-\u5143", "\u620c\u9149\u7533-\u5143", "\u5bc5\u620c\u672a-\u4f0f"], "\u4e01\u4ea5": ["\u5df3\u620c\u536f-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u5348\u4e11\u7533-\u91cd", "\u672a\u536f\u4ea5-\u6d89", "\u5df3\u5bc5\u4ea5-\u5143", "\u9149\u672a\u5df3-\u9065", "\u620c\u9149\u7533-\u5143", "\u4ea5\u672a\u4e11-\u4f0f", "\u7533\u9149\u620c-\u91cd", "\u9149\u4ea5\u4e11-\u91cd", "\u5348\u620c\u5bc5-\u6634", "\u672a\u4ea5\u536f-\u91cd"], "\u8f9b\u672a": ["\u5bc5\u8fb0\u5348-\u9065", "\u4ea5\u4e11\u4e11-\u522b", "\u4ea5\u536f\u672a-\u6bd4", "\u5df3\u620c\u536f-\u6d89", "\u5df3\u4e11\u8fb0-\u8fd4", "\u9149\u8fb0\u4ea5-\u6d89", "\u536f\u4ea5\u672a-\u77e5", "\u4ea5\u672a\u672a-\u522b", "\u5348\u8fb0\u5bc5-\u5143", "\u5df3\u8fb0\u536f-\u9065", "\u672a\u4e11\u620c-\u4f0f", "\u7533\u4ea5\u7533-\u6634"], "\u5df1\u672a": ["\u5df3\u620c\u536f-\u6bd4", "\u5df3\u4e11\u4e11-\u8fd4", "\u9149\u8fb0\u4ea5-\u77e5", "\u536f\u4ea5\u672a-\u5143", "\u4ea5\u8fb0\u8fb0-\u516b", "\u4e11\u5df3\u5df3-\u516b", "\u536f\u5348\u5348-\u516b", "\u672a\u4e11\u620c-\u4f0f", "\u672a\u7533\u7533-\u516b", "\u9149\u9149\u9149-\u72ec", "\u4ea5\u620c\u620c-\u516b", "\u4ea5\u536f\u672a-\u91cd"], "\u4e19\u620c": ["\u5b50\u672a\u5bc5-\u77e5", "\u9149\u5df3\u4e11-\u9065", "\u4ea5\u7533\u5df3-\u9065", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u4ea5\u5b50\u4e11-\u91cd", "\u5b50\u5bc5\u8fb0-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u91cd", "\u7533\u4e11\u5348-\u77e5", "\u5df3\u4ea5\u5df3-\u8fd4"], "\u4e59\u5df3": ["\u9149\u5df3\u4e11-\u9065", "\u4e11\u620c\u672a-\u91cd", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u8fb0\u5df3\u7533-\u4f0f", "\u672a\u7533\u9149-\u9065", "\u7533\u620c\u5b50-\u91cd", "\u672a\u620c\u4e11-\u6bd4", "\u9149\u4e11\u5df3-\u91cd", "\u5bc5\u672a\u5b50-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u5348\u4e11\u7533-\u91cd"], "\u8f9b\u4ea5": ["\u4e11\u536f\u5df3-\u6d89", "\u5df3\u7533\u4ea5-\u9065", "\u672a\u4ea5\u536f-\u6bd4", "\u536f\u7533\u4e11-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u5348\u4e11\u7533-\u91cd", "\u672a\u536f\u4ea5-\u6d89", "\u5df3\u5bc5\u4ea5-\u5143", "\u5348\u8fb0\u5bc5-\u5143", "\u620c\u9149\u7533-\u5143", "\u4ea5\u620c\u672a-\u4f0f", "\u4e11\u5bc5\u536f-\u5143"], "\u5e9a\u5348": ["\u8fb0\u7533\u5b50-\u6d89", "\u8fb0\u9149\u5bc5-\u77e5", "\u5bc5\u7533\u5bc5-\u8fd4", "\u620c\u5df3\u5b50-\u6bd4", "\u620c\u5b50\u5bc5-\u6d89", "\u5df3\u5bc5\u4ea5-\u5143", "\u5348\u8fb0\u5bc5-\u6d89", "\u5348\u5df3\u8fb0-\u9065", "\u7533\u5bc5\u5df3-\u4f0f", "\u620c\u672a\u9149-\u6634", "\u7533\u620c\u5b50-\u6d89", "\u9149\u5b50\u536f-\u91cd"], "\u7678\u9149": ["\u672a\u5348\u5df3-\u9065", "\u4e11\u620c\u672a-\u4f0f", "\u4ea5\u5b50\u4e11-\u91cd", "\u4e11\u536f\u5df3-\u5143", "\u8fb0\u672a\u620c-\u5143", "\u9149\u4e11\u5df3-\u6d89", "\u672a\u5b50\u5df3-\u6bd4", "\u536f\u9149\u536f-\u8fd4", "\u536f\u620c\u5df3-\u6d89", "\u5df3\u9149\u4e11-\u5143", "\u5348\u536f\u5b50-\u6d89", "\u672a\u5df3\u536f-\u9065"], "\u7532\u8fb0": ["\u620c\u7533\u5348-\u6d89", "\u5b50\u4ea5\u620c-\u6bd4", "\u5bc5\u5df3\u7533-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u6d89", "\u7533\u4ea5\u5bc5-\u91cd", "\u7533\u5b50\u8fb0-\u9065", "\u5bc5\u672a\u5b50-\u6d89", "\u5bc5\u7533\u5bc5-\u8fd4", "\u5348\u4e11\u7533-\u6bd4", "\u620c\u5348\u5bc5-\u6d89", "\u7533\u5df3\u5bc5-\u9065"], "\u58ec\u8fb0": ["\u4e11\u5bc5\u536f-\u5143", "\u7533\u620c\u5b50-\u91cd", "\u620c\u4e11\u8fb0-\u9065", "\u672a\u4ea5\u536f-\u91cd", "\u5bc5\u672a\u5b50-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u5348\u4e11\u7533-\u6bd4", "\u5b50\u7533\u8fb0-\u91cd", "\u5df3\u5bc5\u4ea5-\u5143", "\u5bc5\u5b50\u620c-\u5143", "\u620c\u9149\u7533-\u77e5", "\u4ea5\u8fb0\u620c-\u4f0f"], "\u7678\u4ea5": ["\u620c\u9149\u7533-\u5143", "\u4e11\u620c\u672a-\u4f0f", "\u4e11\u5bc5\u536f-\u5143", "\u4e11\u536f\u5df3-\u6d89", "\u8fb0\u672a\u620c-\u5143", "\u9149\u4e11\u5df3-\u6d89", "\u5348\u4ea5\u8fb0-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u536f\u620c\u5df3-\u6bd4", "\u672a\u536f\u4ea5-\u6d89", "\u5df3\u5bc5\u4ea5-\u77e5", "\u672a\u5df3\u536f-\u9065"], "\u58ec\u5bc5": ["\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u672a\u4ea5\u536f-\u91cd", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4", "\u5348\u8fb0\u7533-\u91cd", "\u620c\u5348\u5bc5-\u91cd", "\u5df3\u5bc5\u4ea5-\u5143", "\u620c\u7533\u5348-\u5143", "\u5b50\u4ea5\u620c-\u6bd4", "\u4ea5\u5bc5\u5df3-\u4f0f"], "\u7532\u5bc5": ["\u620c\u7533\u5348-\u5143", "\u5b50\u4ea5\u620c-\u6bd4", "\u5bc5\u5df3\u7533-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u7533\u5348\u5348-\u516b", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4", "\u9149\u8fb0\u4ea5-\u5143", "\u620c\u5348\u5bc5-\u91cd", "\u4e11\u4ea5\u4ea5-\u516b"], "\u58ec\u5b50": ["\u5bc5\u536f\u8fb0-\u77e5", "\u8fb0\u5348\u7533-\u91cd", "\u5348\u9149\u5b50-\u9065", "\u672a\u4ea5\u536f-\u91cd", "\u5df3\u620c\u536f-\u91cd", "\u5348\u5b50\u5348-\u8fd4", "\u5348\u4e11\u7533-\u91cd", "\u672a\u536f\u4ea5-\u6d89", "\u5348\u536f\u5b50-\u77e5", "\u620c\u7533\u5348-\u5143", "\u620c\u9149\u7533-\u5143", "\u4ea5\u5b50\u536f-\u4f0f"], "\u5df1\u9149": ["\u672a\u5b50\u5df3-\u6d89", "\u536f\u9149\u536f-\u8fd4", "\u4ea5\u5348\u4e11-\u91cd", "\u5df3\u4e11\u9149-\u6d89", "\u5348\u536f\u5b50-\u5143", "\u536f\u4e11\u4ea5-\u9065", "\u620c\u5348\u7533-\u6634", "\u9149\u672a\u4e11-\u4f0f", "\u4ea5\u5b50\u4e11-\u91cd", "\u4e11\u536f\u5df3-\u5143", "\u536f\u5348\u9149-\u9065", "\u4ea5\u536f\u672a-\u91cd"], "\u620a\u620c": ["\u5b50\u672a\u5bc5-\u91cd", "\u5bc5\u620c\u5348-\u9065", "\u5bc5\u4ea5\u7533-\u5143", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u4ea5\u5b50\u4e11-\u91cd", "\u5b50\u5bc5\u8fb0-\u91cd", "\u5bc5\u4ea5\u5df3-\u9065", "\u5bc5\u5348\u620c-\u5143", "\u7533\u4e11\u5348-\u77e5", "\u5df3\u4ea5\u5df3-\u8fd4"], "\u620a\u5348": ["\u5b50\u672a\u5bc5-\u91cd", "\u620c\u5348\u5bc5-\u91cd", "\u5bc5\u4ea5\u7533-\u5143", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u5bc5\u5348\u5348-\u522b", "\u7533\u620c\u5b50-\u91cd", "\u9149\u5b50\u536f-\u91cd", "\u5bc5\u5348\u620c-\u5143", "\u8fb0\u9149\u5bc5-\u77e5", "\u5348\u5b50\u5348-\u8fd4"], "\u4e19\u5348": ["\u5b50\u672a\u5bc5-\u77e5", "\u620c\u5348\u5bc5-\u91cd", "\u5b50\u9149\u5348-\u9065", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u7533\u9149\u620c-\u9065", "\u7533\u620c\u5b50-\u91cd", "\u7533\u4ea5\u5bc5-\u6bd4", "\u9149\u4e11\u5df3-\u91cd", "\u8fb0\u9149\u5bc5-\u77e5", "\u5348\u5b50\u5348-\u8fd4"], "\u8f9b\u536f": ["\u5df3\u672a\u9149-\u9065", "\u9149\u5b50\u536f-\u91cd", "\u672a\u4ea5\u536f-\u6d89", "\u536f\u7533\u4e11-\u91cd", "\u536f\u9149\u536f-\u8fd4", "\u620c\u5df3\u5b50-\u91cd", "\u672a\u536f\u4ea5-\u77e5", "\u5b50\u672a\u5b50-\u6634", "\u4ea5\u9149\u672a-\u6d89", "\u4e11\u5b50\u4ea5-\u91cd", "\u536f\u5b50\u5348-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd"], "\u58ec\u7533": ["\u4e11\u5bc5\u536f-\u5143", "\u5b50\u5bc5\u8fb0-\u91cd", "\u5df3\u7533\u4ea5-\u9065", "\u672a\u4ea5\u536f-\u91cd", "\u8fb0\u9149\u5bc5-\u5143", "\u5bc5\u7533\u5bc5-\u8fd4", "\u5348\u4e11\u7533-\u6d89", "\u5b50\u7533\u8fb0-\u91cd", "\u5df3\u5bc5\u4ea5-\u5143", "\u5348\u8fb0\u5bc5-\u9065", "\u620c\u9149\u7533-\u5143", "\u4ea5\u7533\u5bc5-\u4f0f"], "\u4e19\u7533": ["\u620c\u5df3\u5b50-\u6bd4", "\u5b50\u7533\u8fb0-\u91cd", "\u5df3\u5bc5\u4ea5-\u5143", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u9149\u620c\u4ea5-\u9065", "\u5b50\u5bc5\u8fb0-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u91cd", "\u536f\u7533\u4e11-\u5143", "\u5bc5\u7533\u5bc5-\u8fd4"], "\u8f9b\u5df3": ["\u5bc5\u8fb0\u5348-\u9065", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u6bd4", "\u536f\u7533\u4e11-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u672a\u5bc5\u9149-\u6d89", "\u5348\u5bc5\u620c-\u5143", "\u5bc5\u4ea5\u7533-\u9065", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u5348\u672a\u7533-\u9065"], "\u7678\u536f": ["\u4e11\u5b50\u4ea5-\u91cd", "\u4e11\u620c\u672a-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u672a\u9149\u4ea5-\u9065", "\u9149\u5b50\u536f-\u91cd", "\u9149\u4e11\u5df3-\u6d89", "\u5348\u4ea5\u8fb0-\u91cd", "\u536f\u9149\u536f-\u8fd4", "\u536f\u620c\u5df3-\u6bd4", "\u672a\u536f\u4ea5-\u6d89", "\u620c\u672a\u8fb0-\u5143", "\u4e11\u4ea5\u9149-\u6d89"], "\u4e59\u4e11": ["\u5df3\u4e11\u9149-\u5143", "\u4e11\u620c\u672a-\u91cd", "\u4ea5\u9149\u672a-\u91cd", "\u5b50\u4ea5\u620c-\u91cd", "\u8fb0\u4e11\u620c-\u4f0f", "\u5bc5\u536f\u8fb0-\u5143", "\u7533\u620c\u5b50-\u91cd", "\u672a\u620c\u4e11-\u91cd", "\u9149\u4e11\u5df3-\u91cd", "\u5bc5\u672a\u5b50-\u91cd", "\u620c\u8fb0\u620c-\u8fd4", "\u536f\u620c\u5df3-\u6bd4"], "\u4e01\u536f": ["\u5df3\u620c\u536f-\u91cd", "\u536f\u4e11\u536f-\u8fd4", "\u620c\u5df3\u5b50-\u91cd", "\u672a\u536f\u4ea5-\u5143", "\u5b50\u9149\u5348-\u9065", "\u4ea5\u9149\u672a-\u6d89", "\u4e11\u5b50\u4ea5-\u91cd", "\u536f\u5b50\u5348-\u4f0f", "\u8fb0\u5df3\u5348-\u6d89", "\u9149\u4ea5\u4e11-\u91cd", "\u9149\u5b50\u536f-\u91cd", "\u672a\u4ea5\u536f-\u6d89"], "\u7532\u5b50": ["\u620c\u7533\u5348-\u5143", "\u5b50\u620c\u4ea5-\u6bd4", "\u5bc5\u5df3\u7533-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u8fb0\u7533\u5b50-\u5143", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4", "\u5bc5\u9149\u8fb0-\u77e5", "\u620c\u5348\u7533-\u91cd", "\u5348\u536f\u5b50-\u5143"], "\u4e19\u8fb0": ["\u5348\u4e11\u7533-\u6bd4", "\u5b50\u7533\u8fb0-\u91cd", "\u4ea5\u7533\u5df3-\u9065", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u4ea5\u5348\u5348-\u522b", "\u7533\u620c\u5b50-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u91cd", "\u5bc5\u672a\u5b50-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4"], "\u620a\u5bc5": ["\u5b50\u672a\u5bc5-\u91cd", "\u620c\u5348\u5bc5-\u91cd", "\u5bc5\u4ea5\u7533-\u5143", "\u4e11\u4ea5\u9149-\u91cd", "\u5b50\u4ea5\u620c-\u6bd4", "\u5df3\u7533\u5bc5-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u4e11\u5348\u9149-\u6634", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4"], "\u58ec\u5348": ["\u4e11\u5bc5\u536f-\u5143", "\u7533\u620c\u5b50-\u91cd", "\u9149\u5b50\u536f-\u91cd", "\u672a\u4ea5\u536f-\u91cd", "\u8fb0\u9149\u5bc5-\u77e5", "\u5348\u5b50\u5348-\u8fd4", "\u5348\u4e11\u7533-\u91cd", "\u620c\u5348\u5bc5-\u91cd", "\u5df3\u5bc5\u4ea5-\u5143", "\u5bc5\u5b50\u620c-\u5143", "\u620c\u9149\u7533-\u5143", "\u4ea5\u5348\u5b50-\u4f0f"], "\u5e9a\u5bc5": ["\u8fb0\u7533\u5b50-\u5143", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4", "\u620c\u5df3\u5b50-\u6bd4", "\u620c\u5348\u5bc5-\u6d89", "\u5df3\u5bc5\u4ea5-\u5143", "\u5348\u8fb0\u5bc5-\u6d89", "\u5b50\u4ea5\u620c-\u6bd4", "\u7533\u5bc5\u5df3-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u6d89", "\u7533\u4ea5\u5bc5-\u91cd"], "\u7532\u5348": ["\u620c\u7533\u5b50-\u6d89", "\u5b50\u4ea5\u620c-\u6bd4", "\u5bc5\u5df3\u7533-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u8fb0\u5348\u7533-\u6d89", "\u7533\u4ea5\u5bc5-\u6bd4", "\u5bc5\u5348\u620c-\u5143", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4", "\u9149\u8fb0\u4ea5-\u5143", "\u620c\u5348\u7533-\u91cd", "\u7533\u5df3\u5bc5-\u9065"], "\u5df1\u4ea5": ["\u5df3\u620c\u536f-\u6bd4", "\u5df3\u4ea5\u5df3-\u8fd4", "\u5348\u4e11\u7533-\u91cd", "\u672a\u536f\u4ea5-\u6d89", "\u5df3\u5bc5\u4ea5-\u5143", "\u536f\u4e11\u4ea5-\u9065", "\u620c\u9149\u7533-\u5143", "\u4ea5\u672a\u4e11-\u4f0f", "\u4e11\u5bc5\u536f-\u5143", "\u4e11\u536f\u5df3-\u6d89", "\u5bc5\u5df3\u7533-\u9065", "\u672a\u4ea5\u536f-\u6d89"], "\u5e9a\u7533": ["\u8fb0\u7533\u5b50-\u5143", "\u536f\u4e11\u4e11-\u516b", "\u5bc5\u7533\u5bc5-\u8fd4", "\u620c\u5df3\u5b50-\u6bd4", "\u5b50\u7533\u8fb0-\u91cd", "\u5df3\u5bc5\u4ea5-\u5143", "\u5348\u8fb0\u5bc5-\u5143", "\u9149\u672a\u672a-\u516b", "\u7533\u5bc5\u5df3-\u4f0f", "\u4ea5\u9149\u9149-\u516b", "\u5b50\u5bc5\u8fb0-\u91cd", "\u4e11\u4ea5\u4ea5-\u516b"], "\ufeff\u5e72\u652f": ["\u5e72\u4e0a\u5b50", "\u5e72\u4e0a\u4e11", "\u5e72\u4e0a\u5bc5", "\u5e72\u4e0a\u536f", "\u5e72\u4e0a\u8fb0", "\u5e72\u4e0a\u5df3", "\u5e72\u4e0a\u5348", "\u5e72\u4e0a\u672a", "\u5e72\u4e0a\u7533", "\u5e72\u4e0a\u9149", "\u5e72\u4e0a\u620c", "\u5e72\u4e0a\u4ea5"], "\u7678\u672a": ["\u5df3\u8fb0\u536f-\u9065", "\u4e11\u620c\u672a-\u4f0f", "\u7533\u5bc5\u7533-\u6634", "\u5df3\u672a\u9149-\u9065", "\u8fb0\u672a\u620c-\u5143", "\u9149\u4e11\u5df3-\u6d89", "\u5df3\u620c\u536f-\u77e5", "\u672a\u4e11\u672a-\u8fd4", "\u536f\u620c\u5df3-\u91cd", "\u536f\u4ea5\u672a-\u6d89", "\u620c\u672a\u8fb0-\u5143", "\u5df3\u536f\u4e11-\u9065"], "\u7532\u620c": ["\u5348\u8fb0\u7533-\u6d89", "\u5b50\u4ea5\u620c-\u6bd4", "\u5bc5\u5df3\u7533-\u4f0f", "\u8fb0\u5df3\u5348-\u6bd4", "\u8fb0\u5348\u7533-\u6d89", "\u7533\u4ea5\u5bc5-\u91cd", "\u5bc5\u5348\u620c-\u5143", "\u5b50\u5df3\u620c-\u6bd4", "\u5bc5\u7533\u5bc5-\u8fd4", "\u5b50\u672a\u5bc5-\u77e5", "\u5bc5\u5348\u620c-\u91cd", "\u5df3\u7533\u5bc5-\u9065"], "\u4e59\u536f": ["\u672a\u536f\u4ea5-\u5143", "\u4e11\u620c\u672a-\u91cd", "\u4ea5\u9149\u672a-\u6d89", "\u4e11\u5b50\u4ea5-\u91cd", "\u8fb0\u536f\u5b50-\u4f0f", "\u8fb0\u5df3\u5348-\u91cd", "\u7533\u620c\u5b50-\u91cd", "\u9149\u5b50\u536f-\u6d89", "\u672a\u4ea5\u536f-\u6d89", "\u5bc5\u672a\u5b50-\u91cd", "\u536f\u9149\u536f-\u8fd4", "\u5348\u4e11\u7533-\u6d89"], "\u4e59\u9149": ["\u5df3\u4e11\u9149-\u5143", "\u4e11\u620c\u672a-\u91cd", "\u672a\u5df3\u536f-\u9065", "\u7533\u672a\u5348-\u9065", "\u8fb0\u9149\u536f-\u4f0f", "\u4ea5\u5b50\u4e11-\u91cd", "\u7533\u620c\u5b50-\u91cd", "\u672a\u620c\u4e11-\u91cd", "\u7533\u5b50\u8fb0-\u5143", "\u672a\u5b50\u5df3-\u6bd4", "\u536f\u9149\u536f-\u8fd4", "\u4ea5\u5348\u4e11-\u6bd4"], "\u620a\u5b50": ["\u5b50\u672a\u5bc5-\u91cd", "\u5df3\u7533\u4e11-\u6634", "\u5bc5\u4ea5\u7533-\u6d89", "\u4e11\u4ea5\u9149-\u91cd", "\u620c\u9149\u7533-\u77e5", "\u5df3\u7533\u5bc5-\u4f0f", "\u5bc5\u536f\u8fb0-\u77e5", "\u8fb0\u5348\u7533-\u91cd", "\u536f\u5348\u9149-\u9065", "\u8fb0\u7533\u5b50-\u5143", "\u5df3\u620c\u536f-\u91cd", "\u5348\u5b50\u5348-\u8fd4"], "\u8f9b\u9149": ["\u4e11\u536f\u5df3-\u5143", "\u536f\u5348\u9149-\u9065", "\u5bc5\u5348\u620c-\u91cd", "\u672a\u5b50\u5df3-\u6d89", "\u536f\u9149\u536f-\u8fd4", "\u4ea5\u5348\u4e11-\u91cd", "\u5df3\u4e11\u9149-\u77e5", "\u5348\u536f\u5b50-\u5143", "\u5348\u8fb0\u5bc5-\u5143", "\u4e11\u9149\u9149-\u522b", "\u9149\u620c\u672a-\u4f0f", "\u4ea5\u5b50\u4e11-\u91cd"], "\u4e01\u5df3": ["\u5df3\u620c\u536f-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u9149\u8fb0\u4ea5-\u6d89", "\u4ea5\u536f\u672a-\u9065", "\u4ea5\u7533\u5df3-\u9065", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u7533\u9149\u620c-\u91cd", "\u9149\u4ea5\u4e11-\u91cd", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u91cd"], "\u5e9a\u8fb0": ["\u8fb0\u7533\u5b50-\u5143", "\u5bc5\u672a\u5b50-\u9065", "\u5bc5\u7533\u5bc5-\u8fd4", "\u5348\u4e11\u7533-\u6d89", "\u5b50\u7533\u8fb0-\u91cd", "\u5df3\u5bc5\u4ea5-\u5143", "\u5bc5\u5b50\u620c-\u6d89", "\u536f\u5bc5\u4e11-\u5143", "\u7533\u5bc5\u5df3-\u4f0f", "\u5348\u672a\u7533-\u9065", "\u7533\u620c\u5b50-\u6d89", "\u5bc5\u5df3\u7533-\u9065"], "\u7678\u5df3": ["\u536f\u5bc5\u4e11-\u5143", "\u4e11\u620c\u672a-\u4f0f", "\u672a\u7533\u9149-\u9065", "\u672a\u9149\u4ea5-\u9065", "\u7533\u4ea5\u5bc5-\u91cd", "\u9149\u4e11\u5df3-\u6d89", "\u5348\u4ea5\u8fb0-\u91cd", "\u5df3\u4ea5\u5df3-\u8fd4", "\u536f\u620c\u5df3-\u91cd", "\u5df3\u4e11\u9149-\u5143", "\u620c\u672a\u8fb0-\u5143", "\u4e11\u4ea5\u9149-\u91cd"], "\u620a\u7533": ["\u5b50\u672a\u5bc5-\u6d89", "\u5b50\u7533\u8fb0-\u91cd", "\u5bc5\u4ea5\u7533-\u77e5", "\u4e11\u4ea5\u9149-\u91cd", "\u536f\u5bc5\u4e11-\u5143", "\u5df3\u7533\u5bc5-\u4f0f", "\u620c\u9149\u5348-\u6634", "\u5b50\u5bc5\u8fb0-\u91cd", "\u5bc5\u5df3\u7533-\u9065", "\u8fb0\u7533\u5b50-\u5143", "\u536f\u7533\u4e11-\u5143", "\u5bc5\u7533\u5bc5-\u8fd4"]};
  return t720[day][i];
}
</script>
<script language="JavaScript" src="_js/lunar.js"></script>
<script language="JavaScript" src="_js/astro.js"></script>
<script language="JavaScript">
"use strict";
function date_to_julian_day(y,m,d) {
  "use strict";
  var a = parseInt((14 - m) / 12);
  var y = y + 4800 - a;
  var m = m + 12*a - 3;
  return d + parseInt((153*m + 2)/5) + 365*y + parseInt(y/4) - parseInt(y/100) + parseInt(y/400) - 32045;
}
function date_to_julian_day2(yr,mh,dy) {
  "use strict";
  var hr = 0;
  var op = false;
  if(yr<-400000 || yr>400000) return false;
  var yp=yr+Math.floor((mh-3)/10);
  if(((yr>1582) || (yr==1582 && mh>10) || (yr==1582 && mh==10 && dy>=15)) || op){
    var init=1721119.5;
    var jdy=Math.floor(yp*365.25)-Math.floor(yp/100)+Math.floor(yp/400);
  }
  else{
    if((yr<1582) || (yr==1582 && mh<10) || (yr==1582 && mh==10 && dy<=4)){
      var init=1721117.5;
      var jdy=Math.floor(yp*365.25);
    }
    else {return false;}
  }
  var mp=Math.floor(mh+9)%12; 
  var jdm=mp*30+Math.floor((mp+1)*34/57);
  var jdd=dy-1;
  var jdh=hr/24;
  var jd=jdy+jdm+jdd+jdh+init;
  return jd;
}
function date_to_julian_time(h,i,s) {
  /*****
   * h: hour
   * i: minutes
   * s: second
   */
  return ((h * 3600) + (i * 60) + s) /86400;
}
function JiQi() {
  "use strict";
  /**
   * 內部參照用
   */
  this.jq = new Array("春分", "清明", "穀雨", "立夏", "小滿", "芒種", "夏至", "小暑", "大暑", "立秋", "處暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪",   "冬至", "小寒", "大寒", "立春", "雨水", "驚蟄");
  /**
   * 輸出用
   */
  this.jq0 = new Array("立春", "雨水", "驚蟄","春分", "清明", "穀雨", "立夏", "小滿", "芒種", "夏至", "小暑", "大暑", "立秋", "處暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪",   "冬至", "小寒", "大寒" );
  /***
  this.ptsa = new Array(485, 203, 199, 182, 156, 136, 77, 74, 70, 58, 52, 50, 45, 44, 29, 18, 17, 16, 14, 12, 12, 12, 9, 8);
  this.ptsb = new Array(324.96, 337.23, 342.08, 27.85, 73.14, 171.52, 222.54, 296.72, 243.58, 119.81, 297.17, 21.02, 247.54, 325.15, 60.93, 155.12, 288.79, 198.04, 199.76, 95.39, 287.11, 320.81, 227.73, 15.45);
  this.ptsc = new Array(1934.136, 32964.467, 20.186, 445267.112, 45036.886, 22518.443, 65928.934, 3034.906, 9037.513, 33718.147, 150.678, 2281.226, 29929.562, 31555.956, 4443.417, 67555.328, 4562.452, 62894.029, 31436.921, 14577.848, 31931.756, 34777.259, 1222.114, 16859.074);
  ***/
  this.jdez = new Array(30);
  this.jdjq=new Array(26);
  /*****
   * 計算指定年份之春分點
   */
  this.VE = function(yy) {
    var yx=yy;
    var jdve = 0;
    if(yx>=1000 && yx<=8001){
      var m=(yx-2000)/1000;
      jdve=2451623.80984+365242.37404*m+0.05169*m*m-0.00411*m*m*m-0.00057*m*m*m*m;
    }
    else{
      if(yx>=-8000 && yx<1000){
        m=yx/1000;
        jdve=1721139.29189+365242.1374*m+0.06134*m*m+0.00111*m*m*m-0.00071*m*m*m*m;
      }
      else{ 
        // 超出計算能力範圍 
        return false;
      }
    }
    return jdve;
  };
  /*****
   * 計算及修正其他星球之影響而產生攝動
   * 取得受perturbation影響所需微調
   */
  this.Perturbation = function(jdez){
    var t=(jdez-2451545)/36525;
    var s=0;
    var ptsa = new Array(485, 203, 199, 182, 156, 136, 77, 74, 70, 58, 52, 50, 45, 44, 29, 18, 17, 16, 14, 12, 12, 12, 9, 8);
    var ptsb = new Array(324.96, 337.23, 342.08, 27.85, 73.14, 171.52, 222.54, 296.72, 243.58, 119.81, 297.17, 21.02, 247.54, 325.15, 60.93, 155.12, 288.79, 198.04, 199.76, 95.39, 287.11, 320.81, 227.73, 15.45);
    var ptsc = new Array(1934.136, 32964.467, 20.186, 445267.112, 45036.886, 22518.443, 65928.934, 3034.906, 9037.513, 33718.147, 150.678, 2281.226, 29929.562, 31555.956, 4443.417, 67555.328, 4562.452, 62894.029, 31436.921, 14577.848, 31931.756, 34777.259, 1222.114, 16859.074);
    for(var k=0;k<=23;k++){
      //s=s+this.ptsa[k]*Math.cos(this.ptsb[k]*2*Math.PI/360+this.ptsc[k]*2*Math.PI/360*t);
      s=s+ptsa[k]*Math.cos(ptsb[k]*2*Math.PI/360+ptsc[k]*2*Math.PI/360*t);
    }
    var w=35999.373*t-2.47;
    var l=1+0.0334*Math.cos(w*2*Math.PI/360)+0.0007*Math.cos(2*w*2*Math.PI/360);
    var ptb=0.00001*s/l;
    return ptb;
  };
  /*****
   * 計算地球運行速度偏差修正值
   * 
   */
  this.DeltaT = function(yy , mm ){
    var u, t, dt, y;
    y = yy + (mm - 0.5) / 12;

    if(y<=-500){	
      u = (y - 1820) / 100;
      dt = (-20 + 32*u*u);}
    else{if(y< 500){
      u = y / 100;
      dt=(10583.6-1014.41*u+33.78311*u*u-5.952053*u*u*u-0.1798452*u*u*u*u+0.022174192*u*u*u*u*u+0.0090316521*u*u*u*u*u*u);}
    else{if(y<1600){
      u = (y - 1000) / 100;
      dt = (1574.2-556.01*u+71.23472*u*u+0.319781*u*u*u-0.8503463*u*u*u*u-0.005050998*u*u*u*u*u+ 0.0083572073*u*u*u*u*u*u);}
    else{if(y<1700){
      t = y - 1600;
      dt = (120 - 0.9808 * t - 0.01532 * t*t + t*t*t / 7129);}
    else{if(y<1800){
      t = y - 1700;
      dt = (8.83 + 0.1603 * t - 0.0059285 * t*t + 0.00013336 * t*t*t - t*t*t*t / 1174000);}
    else{if(y<1860){
      t = y - 1800;
      dt=(13.72-0.332447*t+0.0068612*t*t+0.0041116*t*t*t-0.00037436*t*t*t*t+0.0000121272*t*t*t*t*t-0.0000001699*t*t*t*t*t*t+ 0.000000000875*t*t*t*t*t*t*t);}
    else{if(y<1900){
      t = y - 1860;
      dt = (7.62 + 0.5737 * t - 0.251754 * t*t + 0.01680668 * t*t*t - 0.0004473624 * t*t*t*t + t*t*t*t*t / 233174);}
    else{if(y<1920){
      t = y - 1900;
      dt = (-2.79 + 1.494119 * t - 0.0598939 * t*t + 0.0061966 * t*t*t - 0.000197 * t*t*t*t);}
    else{if(y<1941){
      t = y - 1920;
      dt = (21.2 + 0.84493 * t - 0.0761 * t*t + 0.0020936 * t*t*t);}
    else{if(y<1961){
      t = y - 1950;
      dt = (29.07 + 0.407 * t - t*t / 233 + t*t*t / 2547);}
    else{if(y<1986){
      t = y - 1975;
      dt = (45.45 + 1.067 * t - t*t / 260 - t*t*t / 718);}
    else{if(y<2005){
      t = y - 2000;
      dt = (63.86 + 0.3345 * t - 0.060374 * t*t + 0.0017275 * t*t*t + 0.000651814 * t*t*t*t + 0.00002373599 * t*t*t*t*t);}
    else{if(y<2050){
      t = y - 2000;
      dt = (62.92 + 0.32217 * t + 0.005589 * t*t);}
    else{if(y<2150){
      u = (y - 1820) / 100;
      dt = (-20 + 32*u*u-0.5628*(2150 - y));}
    else{
      u = (y - 1820) / 100;
      dt = (-20 + 32*u*u);}}}}}}}}}}}}}}

    if(y<1955 || y>=2005) dt=dt-(0.000012932*(y-1955)*(y-1955));
    var DeltaT = dt / 60;    //將秒轉換為分
    return DeltaT;
  }
  /*****
   * 
   */
  this.MeanJQJD = function(yy,jdve,ty,ini,num){
    var ath=2*Math.PI/24;
    var tx=(jdve-2451545)/365250;
    var e=0.0167086342-0.0004203654*tx-0.0000126734*tx*tx+0.0000001444*tx*tx*tx-0.0000000002*tx*tx*tx*tx+0.0000000003*tx*tx*tx*tx*tx;
    var tt=yy/1000;
    var vp=111.25586939-17.0119934518333*tt-0.044091890166673*tt*tt-4.37356166661345E-04*tt*tt*tt+8.16716666602386E-06*tt*tt*tt*tt;
    var rvp=vp*2*Math.PI/360;
    var peri = new Array(30);
    var i;
    for(i=1;i<=(ini+num);i++){
      var flag=0;
      var th=ath*(i-1)+rvp;
      if(th>Math.PI && th<=3*Math.PI){
        th=2*Math.PI-th;
        flag=1;
      }
      if(th>3*Math.PI){
        th=4*Math.PI-th;
        flag=2;
      }
      var f1=2*Math.atan((Math.sqrt((1-e)/(1+e))*Math.tan(th/2)));
      var f2=(e*Math.sqrt(1-e*e)*Math.sin(th))/(1+e*Math.cos(th));
      var f=(f1-f2)*ty/2/Math.PI;
      if(flag==1) f=ty-f;
      if(flag==2) f=2*ty-f;
      peri[i]=f;
    }
    for(i=ini;i<=(ini+num);i++){
      this.jdez[i]=jdve+peri[i]-peri[1];
    }
    return true;
  };
  //副程式功能：對Perturbaton作調整後的自春分點開始的24節氣,可只取部份
  this.GetAdjustedJQ = function(yy, ini, num, jdjq){
    var veb=this.VE(yy);
    var ty=this.VE(yy+1)-veb;     //求指定年的春分點及回歸年長
    if(this.MeanJQJD(yy,veb,ty,ini,num)==true){	//輸入指定年,JD,回歸年長,求該回歸年各節氣之長
      for(var i=ini+1;i<=(ini+num);i++){
        var ptb=this.Perturbation(this.jdez[i]);	//取得受perturbation影響所需微調
        var dt=this.DeltaT(yy,Math.floor(i/2)+3);	//修正dynamical time to Universal time
        jdjq[i]=this.jdez[i]+ptb-dt/60/24;	//加上攝動調整值ptb，減去對應的Delta T值(分鐘轉換為日)
        jdjq[i]=jdjq[i]+1/3;	//因中國時間比格林威治時間先行8小時，即1/3日
      }
    }
  }
  /*****
   * 副程式功能：求出以立春點開始的含中氣之12節氣
   */
  this.GetPureJQsinceSpring2 = function(yy, ptsa,ptsb,ptsc, jdpjq){
    var sjdjq=new Array;
    var yea = yy - 1;
    this.GetAdjustedJQ(yea, 21, 3, sjdjq);   //求出含指定年立春開始之3個節氣JD值,以前一年的年值代入
    //轉移春分前之立春至驚蟄之節氣至jdpjq變數中，以重整index
    jdpjq[0] =sjdjq[22];                     //此為立春
    jdpjq[1] =sjdjq[23];                     //此為雨水
    jdpjq[2] =sjdjq[24];                     //此為驚蟄
    yea = yy;
    //GetAdjustedJQ(yea, 0, 26, sjdjq);       //求出指定年節氣之JD值,從驚蟄開始，到雨水
    this.GetAdjustedJQ(yea, 0, 26, sjdjq);       //求出指定年節氣之JD值,從驚蟄開始，到雨水
    //jdpjq[3] =sjdjq[25];                     //此為當年春分
    //轉移春分至小寒之節氣至jdpjq變數中，以重整index
    //jdpjq[3] =sjdjq[0]; 
    for(var i=2;i<=24;i++){
      //jdpjq[i+1] = sjdjq[2 * i];
      jdpjq[i+1] = sjdjq[i-1];
    }
  };
  /*****
   * 將儒略日換成年月日時分秒
   */
  this.Jtime = function(op,jd){
    if(jd>=2299160.5 || op){
      var y4h=146097;
      var init=1721119.5;
    }
    else{
      var y4h=146100;
      var init=1721117.5;
    }
    var jdr=Math.floor(jd-init);
    var yh=y4h/4;
    var cen=Math.floor((jdr+0.75)/yh);
    var d=Math.floor(jdr+0.75-cen*yh);
    var ywl=1461/4;
    var jy=Math.floor((d+0.75)/ywl);
    d=Math.floor(d+0.75-ywl*jy+1);
    var ml=153/5;
    var mp=Math.floor((d-0.5)/ml);
    d=Math.floor((d-0.5)-30.6*mp+1);
    var y=(100*cen)+jy;
    var m=(mp+2)%12+1;
    if(m<3) y=y+1;
    var sd=Math.floor((jd+0.5-Math.floor(jd+0.5))*24*60*60+0.00005);
    var mt=Math.floor(sd/60);
    var ss=sd%60;
    var hh=Math.floor(mt/60);
    var mmt=mt%60;
    var yy=Math.floor(y);
    var mm=Math.floor(m);
    var dd=Math.floor(d);
    var yc="     "+yy;
    yc=yc.substr(yc.length-5,5);
    var dytm=yc;dytm+="年";
    dytm+= ((mm < 10) ? "0" : "") + mm+"月";
    dytm+= ((dd < 10) ? "0" : "") + dd+"日";
    dytm+= ((hh < 10) ? "0" : "") + hh+"時";
    dytm+= ((mmt < 10) ? "0" : "") + mmt+"分";
    dytm+= ((ss < 10) ? "0" : "") + ss+"秒";
    return dytm.trim();
  };
  /**
   * 四柱計算, 子初換日
   */
  this.GetGZ = function(y,m,d,h,i,s) {
    var jtoday = date_to_julian_day2(y,m,d) + 
      date_to_julian_time(h,i,s);
    var jqTime=new Array;
    //var y = this.Jtime(jtoday);
    this.GetPureJQsinceSpring2(y,0,0,0,jqTime);  // 計算當年節氣(以立春日為新一年)
    if(jtoday < jqTime[0]) {
      y = y - 1;
      this.GetPureJQsinceSpring2(y,0,0,0,jqTime);  // 計算上一年節氣(以立春日為新一年)
      console.log("計算上一年節氣(以立春日為新一年)");
    }
    // 四柱回傳
    var tin = "甲乙丙丁戊己庚辛壬癸甲乙丙丁戊己庚辛壬癸甲乙";
    var di  = "子丑寅卯辰巳午未申酉戌亥";
    
    var rtn_gz = new Array;    
    // 計年柱
    var ygz = ((y + 4712 + 24) % 60 + 60) % 60;
    rtn_gz.push(tin[ygz % 10]);
    rtn_gz.push(di[ygz % 12]);
    // 計月柱
    var dgz = -1;
    for(var ii = 24; ii > 0; ii--) {
      if(jtoday > jqTime[ii-1]) {
        dgz = ii;
        break;
      }
    }
    if(dgz < 0) dgz = 1;if(dgz%2 == 0) dgz--;
    dgz = Math.floor(dgz / 2);if(dgz == 12) dgz = 11;
    rtn_gz.push(tin.substr(Math.floor((ygz%10)%5*2+2),12)[dgz]);  // 月干
    rtn_gz.push("寅卯辰巳午未申酉戌亥子丑".charAt(dgz));            // 月支
    // 計日柱
    var jda = jtoday + 0.5;
    var thes = ((jda - Math.floor(jda)) * 86400) + 3600;
    var dayjd = Math.floor(jda) + thes / 86400;
    dgz = (Math.floor(dayjd + 49) % 60 + 60) % 60;
    if(h >= 23) dgz--; // 子正換日處理, 測試用
    rtn_gz.push(tin[dgz % 10]); // 日干
    rtn_gz.push(di[dgz % 12]);  // 日支
    // 計時柱
    var dh = dayjd * 12;
    //var hgz = (Math.floor(dh + 48) % 60 + 60) % 60;console.log('hgz',(Math.floor(dh + 48) % 60));
    var hgz = (Math.floor(dh + 48) % 60 + 60) % 60;
    //console.log(h,Math.ceil(h/2)%12,di[(h/2)%12],di[hgz % 12]);
    //if((h%2) == 1 && i == 0) hgz += 1;
    if((Math.ceil(h/2)%12) != (hgz%12)) hgz++;
    rtn_gz.push(tin[hgz % 10]); // 時干
    rtn_gz.push(di[hgz % 12]);  // 時支
    // 計分柱
    var minhz = i; if(h%2 == 0) minhz += 60; minhz = Math.floor(minhz * 60 / 600);
    var gan_idx = [0,2,4,6,8,0,2,4,6,8];
    rtn_gz.push(tin.substr(gan_idx[tin.indexOf(rtn_gz[6])],12).charAt(minhz)); // 分干
    rtn_gz.push(di[minhz % 12]);  // 分支
    // 計分柱2
    var minhz = i; if(h%2 == 0) minhz += 60; minhz = Math.floor(minhz * 60 % 600 / 50);
    var gan_idx = [0,2,4,6,8,0,2,4,6,8];
    rtn_gz.push(tin.substr(gan_idx[tin.indexOf(rtn_gz[8])],12).charAt(minhz)); // 分干
    rtn_gz.push(di[minhz % 12]);  // 分支
    
    return rtn_gz.join("");
  };
}
/**
 * test program
 */
function BaZi(y,m,d,h,i,s,gender) {
  // 輸入資料
  //var gender = 1; // 性別: 男1 女0
  //var d = new Date(1999,9-1,9,9,9,9); // 人手輸入
  //var d = new Date(); //當下
  //
  var jiqi = new JiQi();
  //var d = new Date();
  //var jtoday = date_to_julian_day2(d.getFullYear(),d.getMonth()+1,d.getDate()) + 
  //  date_to_julian_time(d.getHours(), d.getMinutes(), d.getSeconds());
  var jtoday = date_to_julian_day2(y,m,d)+
    date_to_julian_time(h,i,s);
  var jqTime = new Array;
  jiqi.GetPureJQsinceSpring2(y,0,0,0,jqTime);  // 計算當年節氣(以立春日為新一年)
  if(jtoday < jqTime[0]) {
    jiqi.GetPureJQsinceSpring2(y-1,0,0,0,jqTime);  // 計算上一年節氣(以立春日為新一年)
  }
  document.write("<pre>");
  var jqpos = 0;  // 計算當前節氣
  for(var ii = 1; ii < 25; ii++) {
    if(jtoday < jqTime[ii]) {
      //document.write(d, "\t",jiqi.Jtime(false,jtoday),"\r\n");
      document.write(jiqi.Jtime(false,jtoday),"\r\n");
      document.write(QIMEN_STAR.Solar2Lunar(y,m,d,h,i,s),"\r\n");
      document.write("當前節氣: ",jiqi.jq0[ii-1],"\r\n");
      document.write(jiqi.Jtime(false,jqTime[ii-1]),"\r\n");
      document.write("\r\n");
      jqpos = ii - 1;
      break;
    }
  }
  // 起四柱
  //var fcol = jiqi.GetGZ(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(), d.getMinutes(), d.getSeconds()); // 排四柱
  var fcol = jiqi.GetGZ(y,m,d,h,i,s); // 排四柱
  var tcol0 = new Array;
  var dcol0 = new Array;
  //四柱
  //for(var i = 6; i > -1 ; i -= 2) tcol0.push(fcol[i]);
  //for(var i = 7; i > -1 ; i -= 2) dcol0.push(fcol[i]);
  for(var i = 10; i > -1 ; i -= 2) tcol0.push(fcol[i]);
  for(var i = 11; i > -1 ; i -= 2) dcol0.push(fcol[i]);
  //四柱含分柱
  //tcol0.push(fcol[8]);
  //dcol0.push(fcol[9]);
  document.write("四柱:","\r\n");
  document.write("　　　　　　　　時　　　　　　　月　　　年","\r\n");
  document.write("\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D","\r\n");
  document.write(tcol0.join("　　　"),"\r\n");
  document.write(dcol0.join("　　　"),"\r\n");
  document.write("\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D","\r\n");
  // 起地支藏干
  var dei_hidden = new Array("9  ","597","024","1  ","419","246","35 ","513","648","7  ","473","80 ");
  for(var i = 0; i < 3; i++) {
    var _t_d_h = new Array;   // 印地支藏干用, 無運算之用
    for(var j = 0; j < 6; j++) {
      var _t_dei_idx = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[j]);
      if(dei_hidden[_t_dei_idx][i] == ' ') {
        _t_d_h.push("　");
      } else {
        _t_d_h.push("甲乙丙丁戊己庚辛壬癸".charAt(dei_hidden[_t_dei_idx][i]));
      }
    }
    document.write(_t_d_h.join("　　　"),"\r\n");
  }
  document.write("\uFF0D\uFF0D空亡\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D","\r\n");
  for(var i = 0; i < 6; i++) {
    var chun_sau = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[i]) - "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[i]);
    if(chun_sau < 0) chun_sau += 12;
    var hung_mon = chun_sau - 2;
    if(hung_mon < 0) hung_mon += 12;
    document.write("子丑寅卯辰巳午未申酉戌亥".substr(hung_mon, 2),"　　");
  }
  document.write("\r\n");
  var _cb = $.Callbacks();
  _cb.add(function(value) {
    "use strict";
    document.write("\uFF0D\uFF0D神煞\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D\uFF0D","\r\n");
    var _hh = new Array,
        _dd = new Array,
        _mm = new Array,
        _yy = new Array;
    // 起年神煞
    var _god_e_d = _god_effect_year(fcol);
    var _h = _god_e_d[dcol0[2]],
        _d = _god_e_d[dcol0[3]],
        _m = _god_e_d[dcol0[4]],
        _y = _god_e_d[dcol0[5]];
    for(var o in _h) _hh.push(_h[o]);
    for(var o in _d) _dd.push(_d[o]);
    for(var o in _m) _mm.push(_m[o]);
    //for(var o in _y) _yy.push(_y[o]);
    // 起月神煞-干
    var _god_e_d = _god_effect_month_gan(fcol);
    var _h = _god_e_d[tcol0[2]],
        _d = _god_e_d[tcol0[3]],
        _m = _god_e_d[tcol0[4]],
        _y = _god_e_d[tcol0[5]];
    for(var o in _h) _hh.push(_h[o]);
    for(var o in _d) _dd.push(_d[o]);
    //for(var o in _m) _mm.push(_m[o]);
    for(var o in _y) _yy.push(_y[o]);
    // 起月神煞-支
    var _god_e_d = _god_effect_month_ji(fcol);
    var _h = _god_e_d[dcol0[2]],
        _d = _god_e_d[dcol0[3]],
        _m = _god_e_d[dcol0[4]],
        _y = _god_e_d[dcol0[5]];
    for(var o in _h) _hh.push(_h[o]);
    for(var o in _d) _dd.push(_d[o]);
    //for(var o in _m) _mm.push(_m[o]);
    for(var o in _y) _yy.push(_y[o]);
    // 起日神煞-干
    var _god_e_d = _god_effect_day_gan(fcol);
    var _h = _god_e_d[tcol0[2]],
        _d = _god_e_d[tcol0[3]],
        _m = _god_e_d[tcol0[4]],
        _y = _god_e_d[tcol0[5]];
    for(var o in _h) _hh.push(_h[o]);
    //for(var o in _d) _dd.push(_d[o]);
    for(var o in _m) _mm.push(_m[o]);
    for(var o in _y) _yy.push(_y[o]);
    // 起日神煞-支
    var _god_e_d = _god_effect_day_ji(fcol);
    var _h = _god_e_d[dcol0[2]],
        _d = _god_e_d[dcol0[3]],
        _m = _god_e_d[dcol0[4]],
        _y = _god_e_d[dcol0[5]];
    for(var o in _h) _hh.push(_h[o]);
    //for(var o in _d) _dd.push(_d[o]);
    for(var o in _m) _mm.push(_m[o]);
    for(var o in _y) _yy.push(_y[o]);
    // 輸出
    var _god_e_d_max = Math.max(_hh.length,_dd.length,_mm.length,_yy.length);
    for(var i = 0; i < _god_e_d_max; i++) {
      var t0 = _hh[i] ? _hh[i] : '　　　';
      var t1 = _dd[i] ? _dd[i] : '　　　';
      var t2 = _mm[i] ? _mm[i] : '　　　';
      var t3 = _yy[i] ? _yy[i] : '　　　';
      document.write('　　　　','　　　　',t0,'　',t1,'　',t2,'　',t3,"\r\n");
    }
  });
  _cb.fire("fire");
  document.write("\r\n");
  // 起大運
  var posneg = ("甲乙丙丁戊己庚辛壬癸".indexOf(fcol[0])+1) % 2; // 陰陽年: 陰年0, 陽年1
  var start_time = 0;
  if((gender == 1 && posneg == 1) || (gender == 0 && posneg == 0)) { // 陽男, 陰女
    var jqpos2 = jqpos + (jqpos%2 == 0 ? 2 : 1);
    if(jqpos2 > 23) {
      jqpos2 = 0;
      jiqi.GetPureJQsinceSpring2(y,0,0,0,jqTime);
    }
    start_time = jqTime[jqpos2] - jtoday;
  } else { // 陰男, 陽女
    var jqpos2 = jqpos - (jqpos%2 == 0 ? 0 : 1);
    if(jqpos2 < 0) {
      jqpos2 = 22;
      jiqi.GetPureJQsinceSpring2(y-1,0,0,0,jqTime);
    }
    start_time = jtoday - jqTime[jqpos2];
  }
  // 計小運
  document.write("計小運：","\r\n");
  var start_small = start_time / 3;
  if(start_small < 1) {
    document.write("即年入大運","\r\n");
  } else {
    var tinIdx = "甲乙丙丁戊己庚辛壬癸".indexOf(fcol[6]);
    var deiIdx = "子丑寅卯辰巳午未申酉戌亥".indexOf((fcol[7]));
    var tcol = new Array;
    var dcol = new Array;
    for(var i = 1; i <= start_small; i++) {
      tcol.push("甲乙丙丁戊己庚辛壬癸".charAt((tinIdx+i)%10));
      dcol.push("子丑寅卯辰巳午未申酉戌亥".charAt((deiIdx+i)%12));
    }
    document.write(tcol.join(""),"\r\n");
    document.write(dcol.join(""),"\r\n");
    document.write("\r\n");
  }
  // 計大運起始
  start_time = jtoday + 365.25 * (start_time / 3.0);
  document.write("上大運:\r\n　", jiqi.Jtime(false,start_time),"\r\n");
  document.write("\r\n");
  // 計一百二十年大運, 參照吠陀占星及法達星限120年大限
  var tcol = new Array;
  var dcol = new Array;
  var daicol = new Array;
  var tinIdx = "甲乙丙丁戊己庚辛壬癸".indexOf(fcol[2]);
  var deiIdx = "子丑寅卯辰巳午未申酉戌亥".indexOf((fcol[3]));
  if((gender==1 && posneg==1) || (gender==0 && posneg==0)) { // 陽男, 陰女
    for(var i = 1; i < 13; i++) {
      tcol.push("甲乙丙丁戊己庚辛壬癸".charAt((tinIdx+i)%10));
      dcol.push("子丑寅卯辰巳午未申酉戌亥".charAt((deiIdx+i)%12));
    }
  } else { // 陰男, 陽女
    for(var i = 1; i < 13; i++) {
      var _tmp = (tinIdx-i)%10;
      if(_tmp < 0) _tmp += 10;
      tcol.push("甲乙丙丁戊己庚辛壬癸".charAt(_tmp));
      var _tmp = (deiIdx-i)%12;
      if(_tmp < 0) _tmp += 12; 
      dcol.push("子丑寅卯辰巳午未申酉戌亥".charAt(_tmp));
    }
  }
  document.write("\r\n");
  document.write("計算一百二十年大運:","\r\n");
  /*
  document.write(tcol.join(""),"\r\n");
  document.write(dcol.join(""),"\r\n");
  */
  for(var i = 0; i < 12; i++) {
    //document.write(tcol[i],dcol[i],":",jiqi.Jtime(false,start_time + 3652.5 * i), "\r\n");
    document.write(tcol[i],dcol[i],'　');
    if((i+1)%4 == 0) document.write("\r\n");
  }
  document.write("\r\n");
  /**
  // 計算120年流年
  document.write("計算120年流年(10年為一列)：","\r\n");
  var tinIdx = "甲乙丙丁戊己庚辛壬癸".indexOf(fcol[0]);
  var deiIdx = "子丑寅卯辰巳午未申酉戌亥".indexOf((fcol[1]));
  for(var i = 0; i < 12; i++) {
    var tcol2 = new Array;
    var dcol2 = new Array;
    for(var j = 0; j < 10; j++) {
      tcol2.push("甲乙丙丁戊己庚辛壬癸".charAt((tinIdx + i*10 + j) % 10));
      dcol2.push("子丑寅卯辰巳午未申酉戌亥".charAt((deiIdx + i*10 + j) % 12));
    }
    document.write(tcol2.join(""),"\r\n");
    document.write(dcol2.join(""),"\r\n");
    document.write("\r\n");
  }
  **/
  // 完結
  document.write("</pre>");
}
/**
 * 奇門遁甲計算
 */
function QiMen(y,m,d,h,i,s) {
  //var d = new Date(); //當下
  //
  var _odocwrite = document.write;
  document.write = function(){};
  var luiyin = LuiYin(y,m,d,h,i,0);
  var astro = QIMEN_STAR.astrology(y,m,d,h,i,0);//genResult(y,m,d,h,i,s);
  
  document.write = _odocwrite;
  //
  var jiqi = new JiQi();
  //var d = new Date();
  //var jtoday = date_to_julian_day2(d.getFullYear(),d.getMonth()+1,d.getDate()) + 
  //  date_to_julian_time(d.getHours(), d.getMinutes(), d.getSeconds());
  var jtoday = date_to_julian_day2(y,m,d) + date_to_julian_time(h,i,s);
  var jqTime = new Array;
  jiqi.GetPureJQsinceSpring2(y,0,0,0,jqTime);  // 計算當年節氣(以立春日為新一年)
  if(jtoday < jqTime[0]) {
    jiqi.GetPureJQsinceSpring2(y-1,0,0,0,jqTime);  // 計算上一年節氣(以立春日為新一年)
  }
  document.write("<pre>");
  var jqpos = 0;  // 計算當前節氣
  for(var ii = 1; ii < 25; ii++) {
    if(jtoday < jqTime[ii]) {
      //document.write(d, "\t",jiqi.Jtime(false,jtoday),"\r\n");
      document.write(jiqi.Jtime(false,jtoday),"\r\n");
      document.write(QIMEN_STAR.Solar2Lunar(y,m,d,h,i,s),"\r\n");      
      document.write("當前節氣: ",jiqi.jq0[ii-1],",", jiqi.Jtime(false,jqTime[ii-1]),"\r\n");
      jqpos = ii - 1;
      break;
    }
  }
  // 起四柱
  //var fcol = jiqi.GetGZ(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(), d.getMinutes(), d.getSeconds());
  var fcol = jiqi.GetGZ(y,m,d,h,i,s);
  // 排四柱
  var tcol0 = new Array;
  var dcol0 = new Array;
  for(var i = 6; i > -1 ; i -= 2) tcol0.push(fcol[i]);
  for(var i = 7; i > -1 ; i -= 2) dcol0.push(fcol[i]);
  //
  // 計時家奇門三元
  var idx1 =  "甲乙丙丁戊己庚辛壬癸".indexOf(fcol[4]);
  var idx2 = "子丑寅卯辰巳午未申酉戌亥".indexOf(fcol[5]);
  idx2 = idx2 - idx1 % 5;
  if(idx2 < 0) idx2 += 12;
  idx2 = idx2 % 3;
  if(idx2 > 0) {
    idx2 = (idx2 == 1)? 2 : 1;
  }
  document.write(jiqi.jq0[jqpos],"上中下".charAt(idx2),"元","　");
  //
  // 計算當前局數
  // 計陰陽遁
  var dun_type = 2; // 0為陰遁, 1為陽遁, 其餘為錯誤
  var kook = [8,9,1,3,4,5,4,5,6,9,8,7,2,1,9,7,6,5,6,5,4,1,2,3]; // 局數
  var using_kook = kook[jqpos];  //局數
  //console.log(jtoday, jqTime[21], jqTime[9]);
  if( jtoday > jqTime[9] && jtoday < jqTime[21]) {
    // 陰遁
    dun_type = 0;
    for(var i = 0; i < idx2; i++) {
      using_kook -= 6;
      while(using_kook < 1) using_kook += 9;
    }
  } else {
    // 陽遁
    dun_type = 1;
    for(var i = 0; i < idx2; i++) {
      using_kook += 6;
      while(using_kook > 9) using_kook -= 9;
    }
  }
  //console.log("using_kook",using_kook);
  document.write("陰陽".charAt(dun_type),"遁"," 一二三四五六七八九".charAt(using_kook),"局","\r\n");
  /** 重計時旬首 **/
  //　時旬首
  var chun_sau = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[0]) - "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[0]);
  if(chun_sau < 0) chun_sau += 12;
  // 建地盤
  var dei_pan = ""; // 建地盤
  if(dun_type == 1) { // 陽遁
    //var dei_pan = " 戊己庚辛壬癸丁丙乙戊己庚辛壬癸丁丙乙".substr(9-using_kook+1,9); // 地盤
    var dei_pan = "戊己庚辛壬癸丁丙乙戊己庚辛壬癸丁丙乙".substr(9-using_kook+1,9); // 地盤
  } else { // 陰遁
    //var dei_pan = " 戊乙丙丁癸壬辛庚己戊乙丙丁癸壬辛庚己".substr(9-using_kook+1,9);
    var dei_pan = "戊乙丙丁癸壬辛庚己戊乙丙丁癸壬辛庚己".substr(9-using_kook+1,9);
  }
  // 找值符
  var chun_sau = " 子戌申午辰寅".indexOf("子寅辰午申戌".charAt(parseInt(chun_sau/2)));
  var jik_fu_idx = 0;
  var jik_fu_star = 0;
  var _tmp = tcol0[0];
  if(dun_type == 1) { // 陽遁
    var jik_fu_idx = using_kook + chun_sau - 1;
    while(jik_fu_idx > 9) jik_fu_idx -= 9;
    while(jik_fu_idx < 1) jik_fu_idx += 9;
    if(_tmp == '甲') _tmp = " 戊己庚辛壬癸".charAt(chun_sau);
    //console.log(_tmp,parseInt(chun_sau/2),chun_sau/2,chun_sau);
    jik_fu_star = " 戊己庚辛壬癸丁丙乙".indexOf(_tmp) + using_kook - 1;
    while(jik_fu_star > 9) jik_fu_star -= 9;
  } else {
    var jik_fu_idx = 1 + using_kook - chun_sau;
    while(jik_fu_idx > 9) jik_fu_idx -= 9;
    while(jik_fu_idx < 1) jik_fu_idx += 9;
    //console.log(chun_sau);
    if(_tmp == '甲') _tmp = " 戊己庚辛壬癸".charAt(chun_sau);
    jik_fu_star = 1 + using_kook - " 戊己庚辛壬癸丁丙乙".indexOf(_tmp);
    //console.log(" 戊己庚辛壬癸丁丙乙".indexOf(_tmp));
    while(jik_fu_star < 1) jik_fu_star += 9;
  }
  //if(jik_fu_star == 5) jik_fu_star = 2; // 禽星寄二宮  
  document.write("值符天","，蓬芮衝輔禽心柱任英".charAt(jik_fu_idx),"落",jik_fu_star,"宮","　");
  if(jik_fu_star == 5) jik_fu_star = 2; // 禽星寄二宮
  // 計值使, 不分陰陽遁
  var jik_fu_mun = 0;
  if(dun_type == 1) {
    jik_fu_mun = jik_fu_idx + " 甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[0]) - 1;
    while(jik_fu_mun > 9) jik_fu_mun -= 9;
  } else {
    jik_fu_mun = jik_fu_idx - " 甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[0]) + 1;
    while(jik_fu_mun < 1) jik_fu_mun += 9;
  }
  //console.log("jik_fu_mun:",jik_fu_mun);
  if(jik_fu_mun == 5) jik_fu_mun = 2; // 中宮寄坤二宮
  document.write("值使"," 休死傷杜中開驚生景".charAt(jik_fu_idx),"門落",jik_fu_mun,"宮","\r\n");
  // 計算星盤
  var houses_star_target = "18349276".indexOf(jik_fu_star);
  var houses_star_idx = "183492761834927618349276".substr(8-houses_star_target+1, 8);
  //console.log("houses_star_idx1:",houses_star_idx);
  var houses_star_idx  = [1,8,3,4,9,2,7,6]; var _jfi = (jik_fu_idx == 5 ? 2 : jik_fu_idx);
  while(houses_star_idx[houses_star_target] != _jfi) {
    houses_star_idx.unshift(houses_star_idx.pop());
  }
  var star_pan = new Array; //星盤
  for(var i = 1; i < 10; i++)
  {
    if(i == 5) {
      star_pan.push(5);
    } else {
      star_pan.push(houses_star_idx["18349276".indexOf(i)]);
    }
  }
  var houses_star = new Array;
  for(var i = 0; i < 9; i++) {
    houses_star.push("，蓬苪衝輔禽心柱任英".charAt(star_pan[i]));
  }
  // 計算天盤
  var tin_pan = new Array;  // 天盤
  if( dun_type  == 1) { // 陽遁
    for(var i = 0; i < 9;i++) 
    {
      var _tin = star_pan[i] - using_kook + 1;
      while(_tin < 1) _tin += 9;
      tin_pan.push(" 戊己庚辛壬癸丁丙乙".charAt(_tin));
    }
  } else {
    for(var i = 0; i < 9; i++) {
      var _tin = using_kook - star_pan[i] + 1;
      while(_tin < 1) _tin += 9;
      tin_pan.push(" 戊己庚辛壬癸丁丙乙".charAt(_tin));
    }
  }
  // 計算八門
  var houses_door_target = "18349276".indexOf(jik_fu_mun);
  var houses_door_idx  = [1,8,3,4,9,2,7,6];
  //console.log("houses_door_target: ",houses_door_target);
  //return;
  var _jfi = (jik_fu_idx == 5 ? 2 : jik_fu_idx);
  while(houses_door_idx[houses_door_target] != _jfi) {
    houses_door_idx.unshift(houses_door_idx.pop());
  }
  var door_pan = new Array; //門盤(八門)
  for(var i = 1; i < 10; i++)
  {
    if(i == 5) {
      door_pan.push(5);
    } else {
      door_pan.push(houses_door_idx["18349276".indexOf(i)]);
    }
  }
  var house_door = new Array;
  for(var i = 0; i < 9; i++) {
    house_door.push("，休死傷杜　開驚生景".charAt(door_pan[i]));
  }
  // 計算八神
  var houses_god;
  if(dun_type == 1) { // 陽遁-順排
    var houses_god_target = "18349276".indexOf(jik_fu_star);
    houses_god = ['符','蛇','陰','合','白','玄','地','天'];
    while(houses_god[houses_god_target] != '符') {
      houses_god.unshift(houses_god.pop());
    }
  } else {
    var houses_god_target = "18349276".indexOf(jik_fu_star);
    houses_god = ['符','天','地','玄','白','合','陰','蛇'];
    while(houses_god[houses_god_target] != '符') {
      houses_god.unshift(houses_god.pop());
    }
  }
  var god_pan = new Array; //神盤(八神)
  for(var i = 1; i < 10; i++)
  {
    if(i == 5) {
      god_pan.push('　');
    } else {
      god_pan.push(houses_god["18349276".indexOf(i)]);
    }
  }
  /**
  // 輸出天盤
  document.write("天盤：",tin_pan.join(""),"\r\n");
  // 輸出地盤
  document.write("地盤：",dei_pan,"\r\n");
  // 輸出星盤
  document.write("星盤：",houses_star.join(""),"\r\n");
  // 輸出門盤
  document.write("門盤：",house_door.join(""),"\r\n");
  // 輸出八神
  document.write("神盤：",god_pan.join(""),"\r\n");
  // 完結
  **/
  // 輸出八字
  document.write("八字:");
  for(var i = 0; i < 12; i += 2) document.write("　",fcol.substr(i, 2));
  document.write("\r\n");
  // 計空亡
  document.write("空亡:");
  var _func = function() {
	var _dcol0 = dcol0.slice(), _tcol0 = tcol0.slice();
	_tcol0.unshift(fcol[8]);_dcol0.unshift(fcol[9]);
	_tcol0.unshift(fcol[10]);_dcol0.unshift(fcol[11]);
	//console.log(_tcol0,_dcol0);
	for(var i = 0; i < 6; i++) {
		var chun_sau = "子丑寅卯辰巳午未申酉戌亥".indexOf(_dcol0[5-i]) - "甲乙丙丁戊己庚辛壬癸".indexOf(_tcol0[5-i]);
		if(chun_sau < 0) chun_sau += 12;
		var hung_mon = chun_sau - 2;
		if(hung_mon < 0) hung_mon += 12;
		document.write("　","子丑寅卯辰巳午未申酉戌亥".substr(hung_mon, 2));
	}
	document.write("\r\n");
  };
  _func();
  _func = null;
  //document.write(tcol0.join(""),"\r\n");
  //document.write(dcol0.join(""),"\r\n");
  // 輸出四課三傳
  document.write("四課:　　　　　三傳:","\r\n");
  var _tmp = "";
  for(var i = 0; i < 4; i++) {
    //document.write(luiyin.helpMan.charAt(luiyin.genOnTime.indexOf(luiyin.four[0][i])));
    _tmp += (luiyin.helpMan.charAt(luiyin.genOnTime.indexOf(luiyin.four[0][i])));
  }
  document.write(_tmp,"　　　　",luiyin.three_relation.join(""),"\r\n");
  document.write(luiyin.four[0],"　　　　",luiyin.three_gan.join(""),"\r\n");
  document.write(luiyin.four[1],"　　　　",luiyin.three,"\r\n");
  document.write("　　　　","　　　　",luiyin.three_helper.join(""),"\r\n");
  document.write("\r\n");
  /*
  document.write("三傳:\r\n");
  document.write(luiyin.three_relation.join(""),"\r\n");
  document.write(luiyin.three_gan.join(""),"\r\n");
  document.write(luiyin.three,"\r\n");
  document.write(luiyin.three_helper.join(""),"\r\n");
  */
  /**
   _output.three = _three;
  _output.three_gan = new Array;
  _output.three_relation = new Array;
  _output.three_helper = new Array;
  **/
  //
  // 計紫白飛星
  var purple_star_y = QIMEN_STAR.purple_star.CalYear(y,m,d,h,i,0);
  var purple_star_m = QIMEN_STAR.purple_star.CalMonth(y,m,d,h,i,0);
  var purple_star_d = QIMEN_STAR.purple_star.CalDay(y,m,d,h,i,0);
  var purple_star_h = QIMEN_STAR.purple_star.CalHour(y,m,d,h,i,0);
  //console.log(purple_star_y);
  //console.log(purple_star_m);
  // 
  var _size = 24;
  var _p = new Array(_size);
  for(var i = 0; i < _size;i++)	_p[i] = new Array(_size);
  for(var i = 0; i < _size; i++)
    for(var j =0; j < _size; j++)
      _p[i][j] = '　';
  // 輸出栻盤
  var _start_at = new Object; _start_at.x = 5; _start_at.y = 5;
  var _sqbx = [[4,9,2],[3,5,7],[8,1,6]];
  for(var i = 0; i < 3; i+=1) {
    for(var j =0; j < 3; j+=1) {
      if(_sqbx[i][j] == 5) {
        var _i = _start_at.y;
        var _j = _start_at.x + 2 * 5;
        _p[_i+3][_j] = dei_pan[5-1];
        // 輸出妙派奇門流年紫白飛星
        _p[_start_at.y + 1 * 5 + 3][_start_at.x + 1 * 5 + 2]   = "<font color='purple'>"+purple_star_y[_sqbx[i][j]-1]+"</font>";
        _p[_start_at.y + 1 * 5 + 3][_start_at.x + 1 * 5 + 1]   = "<font color='purple'>"+purple_star_m[_sqbx[i][j]-1]+"</font>";
        _p[_start_at.y + 1 * 5 + 2][_start_at.x + 1 * 5 + 1]   = "<font color='purple'>"+purple_star_d[_sqbx[i][j]-1]+"</font>";
        _p[_start_at.y + 1 * 5 + 2][_start_at.x + 1 * 5 + 2]   = "<font color='purple'>"+purple_star_h[_sqbx[i][j]-1]+"</font>";
        continue;
      }
      //var _i = _start_at.x + i * 4 + 1;
      //var _j = _start_at.y + j * 4 + 1;
      var _i = _start_at.y + i * 5;
      var _j = _start_at.x + j * 5;
      _p[_i][_j]   = house_door[_sqbx[i][j]-1];
      _p[_i][_j+3] = god_pan[_sqbx[i][j]-1];
      _p[_i+1][_j+1] = '天';
      _p[_i+1][_j+2] = houses_star[_sqbx[i][j]-1];
      _p[_i+2][_j+3] = tin_pan[_sqbx[i][j]-1];
      _p[_i+3][_j+3] = dei_pan[_sqbx[i][j]-1];
      //console.log(_sqbx[i][j],': ',houses_star[_sqbx[i][j]-1]);
      if(houses_star[_sqbx[i][j]-1] == '苪') {
        //_p[_i+2][_j+1] = houses_star[5-1];
        _p[_i+2][_j] = tin_pan[5-1];
      }
      // 輸出妙派奇門流年紫白飛星
      _p[_i+3][_j+2]   = "<font color='purple'>"+purple_star_y[_sqbx[i][j]-1]+"</font>";
      _p[_i+3][_j+1]   = "<font color='purple'>"+purple_star_m[_sqbx[i][j]-1]+"</font>";
      _p[_i+2][_j+1]   = "<font color='purple'>"+purple_star_d[_sqbx[i][j]-1]+"</font>";
      _p[_i+2][_j+2]   = "<font color='purple'>"+purple_star_h[_sqbx[i][j]-1]+"</font>";
    }
  }
  
  // astro, 參星
  for(var i in astro.zodiac) {
    for(var j in astro.zodiac[i]) {
      astro.zodiac[i][j] = '<font color="#00FF00">'+astro.zodiac[i][j]+'</font>';
    }
  }
  var _g = luiyin.genOnTime;
  var _got = astro.zodiac[_g[11]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + 16][_start_at.x + 10 + i] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + 17][_start_at.x + 10 + i] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + 18][_start_at.x + 10 + i] = _got[i+8];
  }
  var _got = astro.zodiac[_g[0]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + 16][_start_at.x + 5 + i] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + 17][_start_at.x + 5 + i] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + 18][_start_at.x + 5 + i] = _got[i+8];
  }
  var _got = astro.zodiac[_g[1]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + 16][_start_at.x + i] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + 17][_start_at.x + i] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + 18][_start_at.x + i] = _got[i+8];
  }
  var _got = astro.zodiac[_g[2]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + 10 + i][_start_at.x - 3] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + 10 + i][_start_at.x - 4 ] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + 10 + i][_start_at.x - 5 ] = _got[i+8];
  }
  var _got = astro.zodiac[_g[3]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + 5 + i][_start_at.x - 3] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + 5 + i][_start_at.x - 4 ] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + 5 + i][_start_at.x - 5 ] = _got[i+8];
  }
  var _got = astro.zodiac[_g[4]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + i][_start_at.x - 3] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + i][_start_at.x - 4 ] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + i][_start_at.x - 5 ] = _got[i+8];
  }
  var _got = astro.zodiac[_g[5]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y - 3][_start_at.x + i] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y - 4][_start_at.x + i] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y - 5][_start_at.x + i] = _got[i+8];
  }
  var _got = astro.zodiac[_g[6]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y - 3][_start_at.x + 5 + i] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y - 4][_start_at.x + 5 + i] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y - 5][_start_at.x + 5 + i] = _got[i+8];
  }
  var _got = astro.zodiac[_g[7]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y - 3][_start_at.x + 10 + i] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y - 4][_start_at.x + 10 + i] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y - 5][_start_at.x + 10 + i] = _got[i+8];
  }
  var _got = astro.zodiac[_g[8]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + i][_start_at.x + 16] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + i][_start_at.x + 17] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + i][_start_at.x + 18] = _got[i+8];
  }
  var _got = astro.zodiac[_g[9]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + 5 + i][_start_at.x + 16] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + 5 + i][_start_at.x + 17] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + 5 + i][_start_at.x + 18] = _got[i+8];
  }
  var _got = astro.zodiac[_g[10]];if(_got.length) {
    for(var i = 0; i < 4; i++) if(typeof _got[i] != 'undefined')   _p[_start_at.y + 10 + i][_start_at.x + 16] = _got[i];
    for(var i = 0; i < 4; i++) if(typeof _got[i+4] != 'undefined') _p[_start_at.y + 10 + i][_start_at.x + 17] = _got[i+4];
    for(var i = 0; i < 4; i++) if(typeof _got[i+8] != 'undefined') _p[_start_at.y + 10 + i][_start_at.x + 18] = _got[i+8];
  }
  
  // luiyin.genOnTime
  var _got = luiyin.genOnTime;
  _p[_start_at.y + 14][_start_at.x + 10 + 1] = '<font color="red">'+ _got[11] + "</font>"; // 亥
  _p[_start_at.y + 14][_start_at.x + 5 + 1]  = '<font color="red">'+ _got[0]  + "</font>"; // 子
  _p[_start_at.y + 14][_start_at.x + 0 + 1]  = '<font color="red">'+ _got[1]  + "</font>"; // 丑
  _p[_start_at.y + 10 + 1][_start_at.x - 1]  = '<font color="red">'+ _got[2]  + "</font>"; // 寅
  _p[_start_at.y + 5 + 1][_start_at.x - 1]   = '<font color="red">'+ _got[3]  + "</font>"; // 卯
  _p[_start_at.y + 0 + 1][_start_at.x - 1]   = '<font color="red">'+ _got[4]  + "</font>"; // 寅
  _p[_start_at.y - 1][_start_at.x + 0 + 1]   = '<font color="red">'+ _got[5]  + "</font>"; // 巳
  _p[_start_at.y - 1][_start_at.x + 5 + 1]   = '<font color="red">'+ _got[6]  + "</font>"; // 午
  _p[_start_at.y - 1][_start_at.x + 10 + 1]  = '<font color="red">'+ _got[7]  + "</font>"; // 未
  _p[_start_at.y + 0 + 1][_start_at.x + 14]  = '<font color="red">'+ _got[8]  + "</font>"; // 申
  _p[_start_at.y + 5 + 1][_start_at.x + 14]  = '<font color="red">'+ _got[9]  + "</font>"; // 酉
  _p[_start_at.y + 10 + 1][_start_at.x + 14] = '<font color="red">'+ _got[10] + "</font>"; // 戌
  // LuiYin.helpMan
  var _got = luiyin.helpMan;
  _p[_start_at.y + 14][_start_at.x + 10 + 2] = '<font color="red">'+ _got[11] + "</font>"; // 亥
  _p[_start_at.y + 14][_start_at.x + 5 + 2]  = '<font color="red">'+ _got[0]  + "</font>"; // 子
  _p[_start_at.y + 14][_start_at.x + 0 + 2]  = '<font color="red">'+ _got[1]  + "</font>"; // 丑
  _p[_start_at.y + 10 + 2][_start_at.x - 1]  = '<font color="red">'+ _got[2]  + "</font>"; // 寅
  _p[_start_at.y + 5 + 2][_start_at.x - 1]   = '<font color="red">'+ _got[3]  + "</font>"; // 卯
  _p[_start_at.y + 0 + 2][_start_at.x - 1]   = '<font color="red">'+ _got[4]  + "</font>"; // 寅
  _p[_start_at.y - 1][_start_at.x + 0 + 2]   = '<font color="red">'+ _got[5]  + "</font>"; // 巳
  _p[_start_at.y - 1][_start_at.x + 5 + 2]   = '<font color="red">'+ _got[6]  + "</font>"; // 午
  _p[_start_at.y - 1][_start_at.x + 10 + 2]  = '<font color="red">'+ _got[7]  + "</font>"; // 未
  _p[_start_at.y + 0 + 2][_start_at.x + 14]  = '<font color="red">'+ _got[8]  + "</font>"; // 申
  _p[_start_at.y + 5 + 2][_start_at.x + 14]  = '<font color="red">'+ _got[9]  + "</font>"; // 酉
  _p[_start_at.y + 10 + 2][_start_at.x + 14] = '<font color="red">'+ _got[10] + "</font>"; // 戌
  //　輸出時日天干用以穿壬
    //年旬干
    var chun_sau = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[3]) - "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[3]);
    if(chun_sau < 0) chun_sau += 12;
    var chun_gan = "甲乙丙丁戊己庚辛壬癸\uFF0A\uFF0A甲乙丙丁戊己庚辛壬癸\uFF0A\uFF0A".substr(12-chun_sau,12);
    chun_gan = chun_gan.substr("子丑寅卯辰巳午未申酉戌亥".indexOf(luiyin.genOnTime[0])) +
      chun_gan.substr(0,"子丑寅卯辰巳午未申酉戌亥".indexOf(luiyin.genOnTime[0]));
    var _got = chun_gan;
    _p[_start_at.y + 15][_start_at.x + 10 + 0] = '<font color="yellow">'+ _got[11] + "</font>"; // 亥
    _p[_start_at.y + 15][_start_at.x + 5 + 0]  = '<font color="yellow">'+ _got[0]  + "</font>"; // 子
    _p[_start_at.y + 15][_start_at.x + 0 + 0]  = '<font color="yellow">'+ _got[1]  + "</font>"; // 丑
    _p[_start_at.y + 10 + 0][_start_at.x - 2]  = '<font color="yellow">'+ _got[2]  + "</font>"; // 寅
    _p[_start_at.y + 5 + 0][_start_at.x - 2]   = '<font color="yellow">'+ _got[3]  + "</font>"; // 卯
    _p[_start_at.y + 0 + 0][_start_at.x - 2]   = '<font color="yellow">'+ _got[4]  + "</font>"; // 寅
    _p[_start_at.y - 2][_start_at.x + 0 + 0]   = '<font color="yellow">'+ _got[5]  + "</font>"; // 巳
    _p[_start_at.y - 2][_start_at.x + 5 + 0]   = '<font color="yellow">'+ _got[6]  + "</font>"; // 午
    _p[_start_at.y - 2][_start_at.x + 10 + 0]  = '<font color="yellow">'+ _got[7]  + "</font>"; // 未
    _p[_start_at.y + 0 + 0][_start_at.x + 15]  = '<font color="yellow">'+ _got[8]  + "</font>"; // 申
    _p[_start_at.y + 5 + 0][_start_at.x + 15]  = '<font color="yellow">'+ _got[9]  + "</font>"; // 酉
    _p[_start_at.y + 10 + 0][_start_at.x + 15] = '<font color="yellow">'+ _got[10] + "</font>"; // 戌
    //月旬干
    var chun_sau = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[2]) - "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[2]);
    if(chun_sau < 0) chun_sau += 12;
    var chun_gan = "甲乙丙丁戊己庚辛壬癸\uFF0A\uFF0A甲乙丙丁戊己庚辛壬癸\uFF0A\uFF0A".substr(12-chun_sau,12);
    chun_gan = chun_gan.substr("子丑寅卯辰巳午未申酉戌亥".indexOf(luiyin.genOnTime[0])) +
      chun_gan.substr(0,"子丑寅卯辰巳午未申酉戌亥".indexOf(luiyin.genOnTime[0]));
    var _got = chun_gan;
    _p[_start_at.y + 15][_start_at.x + 10 + 1] = '<font color="yellow">'+ _got[11] + "</font>"; // 亥
    _p[_start_at.y + 15][_start_at.x + 5 + 1]  = '<font color="yellow">'+ _got[0]  + "</font>"; // 子
    _p[_start_at.y + 15][_start_at.x + 0 + 1]  = '<font color="yellow">'+ _got[1]  + "</font>"; // 丑
    _p[_start_at.y + 10 + 1][_start_at.x - 2]  = '<font color="yellow">'+ _got[2]  + "</font>"; // 寅
    _p[_start_at.y + 5 + 1][_start_at.x - 2]   = '<font color="yellow">'+ _got[3]  + "</font>"; // 卯
    _p[_start_at.y + 0 + 1][_start_at.x - 2]   = '<font color="yellow">'+ _got[4]  + "</font>"; // 寅
    _p[_start_at.y - 2][_start_at.x + 0 + 1]   = '<font color="yellow">'+ _got[5]  + "</font>"; // 巳
    _p[_start_at.y - 2][_start_at.x + 5 + 1]   = '<font color="yellow">'+ _got[6]  + "</font>"; // 午
    _p[_start_at.y - 2][_start_at.x + 10 + 1]  = '<font color="yellow">'+ _got[7]  + "</font>"; // 未
    _p[_start_at.y + 0 + 1][_start_at.x + 15]  = '<font color="yellow">'+ _got[8]  + "</font>"; // 申
    _p[_start_at.y + 5 + 1][_start_at.x + 15]  = '<font color="yellow">'+ _got[9]  + "</font>"; // 酉
    _p[_start_at.y + 10 + 1][_start_at.x + 15] = '<font color="yellow">'+ _got[10] + "</font>"; // 戌
    //日旬干
    var chun_sau = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[1]) - "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[1]);
    if(chun_sau < 0) chun_sau += 12;
    var chun_gan = "甲乙丙丁戊己庚辛壬癸\uFF0A\uFF0A甲乙丙丁戊己庚辛壬癸\uFF0A\uFF0A".substr(12-chun_sau,12);
    chun_gan = chun_gan.substr("子丑寅卯辰巳午未申酉戌亥".indexOf(luiyin.genOnTime[0])) +
      chun_gan.substr(0,"子丑寅卯辰巳午未申酉戌亥".indexOf(luiyin.genOnTime[0]));
    var _got = chun_gan;
    _p[_start_at.y + 15][_start_at.x + 10 + 2] = '<font color="yellow">'+ _got[11] + "</font>"; // 亥
    _p[_start_at.y + 15][_start_at.x + 5 + 2]  = '<font color="yellow">'+ _got[0]  + "</font>"; // 子
    _p[_start_at.y + 15][_start_at.x + 0 + 2]  = '<font color="yellow">'+ _got[1]  + "</font>"; // 丑
    _p[_start_at.y + 10 + 2][_start_at.x - 2]  = '<font color="yellow">'+ _got[2]  + "</font>"; // 寅
    _p[_start_at.y + 5 + 2][_start_at.x - 2]   = '<font color="yellow">'+ _got[3]  + "</font>"; // 卯
    _p[_start_at.y + 0 + 2][_start_at.x - 2]   = '<font color="yellow">'+ _got[4]  + "</font>"; // 寅
    _p[_start_at.y - 2][_start_at.x + 0 + 2]   = '<font color="yellow">'+ _got[5]  + "</font>"; // 巳
    _p[_start_at.y - 2][_start_at.x + 5 + 2]   = '<font color="yellow">'+ _got[6]  + "</font>"; // 午
    _p[_start_at.y - 2][_start_at.x + 10 + 2]  = '<font color="yellow">'+ _got[7]  + "</font>"; // 未
    _p[_start_at.y + 0 + 2][_start_at.x + 15]  = '<font color="yellow">'+ _got[8]  + "</font>"; // 申
    _p[_start_at.y + 5 + 2][_start_at.x + 15]  = '<font color="yellow">'+ _got[9]  + "</font>"; // 酉
    _p[_start_at.y + 10 + 2][_start_at.x + 15] = '<font color="yellow">'+ _got[10] + "</font>"; // 戌
    //時旬干
    var chun_sau = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[0]) - "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[0]);
    if(chun_sau < 0) chun_sau += 12;
    var chun_gan = "甲乙丙丁戊己庚辛壬癸\uFF0A\uFF0A甲乙丙丁戊己庚辛壬癸\uFF0A\uFF0A".substr(12-chun_sau,12);
    //chun_gan = chun_gan.substr("子丑寅卯辰巳午未申酉戌亥".indexOf(luiyin.genOnTime[0])) +
    //  chun_gan.substr(0,"子丑寅卯辰巳午未申酉戌亥".indexOf(luiyin.genOnTime[0]));
    var _got = chun_gan;
    _p[_start_at.y + 14][_start_at.x + 10 + 3] = '<font color="blue">'+ _got[11] + "</font>"; // 亥
    _p[_start_at.y + 14][_start_at.x + 5 + 3]  = '<font color="blue">'+ _got[0]  + "</font>"; // 子
    _p[_start_at.y + 14][_start_at.x + 0 + 3]  = '<font color="blue">'+ _got[1]  + "</font>"; // 丑
    _p[_start_at.y + 10 + 3][_start_at.x - 1]  = '<font color="blue">'+ _got[2]  + "</font>"; // 寅
    _p[_start_at.y + 5 + 3][_start_at.x - 1]   = '<font color="blue">'+ _got[3]  + "</font>"; // 卯
    _p[_start_at.y + 0 + 3][_start_at.x - 1]   = '<font color="blue">'+ _got[4]  + "</font>"; // 寅
    _p[_start_at.y - 1][_start_at.x + 0 + 3]   = '<font color="blue">'+ _got[5]  + "</font>"; // 巳
    _p[_start_at.y - 1][_start_at.x + 5 + 3]   = '<font color="blue">'+ _got[6]  + "</font>"; // 午
    _p[_start_at.y - 1][_start_at.x + 10 + 3]  = '<font color="blue">'+ _got[7]  + "</font>"; // 未
    _p[_start_at.y + 0 + 3][_start_at.x + 14]  = '<font color="blue">'+ _got[8]  + "</font>"; // 申
    _p[_start_at.y + 5 + 3][_start_at.x + 14]  = '<font color="blue">'+ _got[9]  + "</font>"; // 酉
    _p[_start_at.y + 10 + 3][_start_at.x + 14] = '<font color="blue">'+ _got[10] + "</font>"; // 戌
  ////console.log("LuiYin.helpMan:",luiyin.helpMan);
  ////console.log("LuiYin.genOnTime:",luiyin.genOnTime);
  /** 畫井字 **/
  for(var i = 0; i < 14; i++) {
	_p[_start_at.y + 4][_start_at.x + i] = "\uFF0D";
	_p[_start_at.y + 9][_start_at.x + i] = "\uFF0D";
	_p[_start_at.y + i][_start_at.x + 4] = "\uFF5C";
	_p[_start_at.y + i][_start_at.x + 9] = "\uFF5C";
  }
  _p[_start_at.y + 4][_start_at.x + 4] = "\uFF0B";
  _p[_start_at.y + 4][_start_at.x + 9] = "\uFF0B";
  _p[_start_at.y + 9][_start_at.x + 4] = "\uFF0B";
  _p[_start_at.y + 9][_start_at.x + 9] = "\uFF0B";
  /** 輸出印出栻盤 **/
  for(var i = 0; i < _size; i++) {//console.log(i,_p[i]);
    document.write(_p[i].join(""),"\r\n");
  }
  document.write("\r\n");
  /** 十干生剋 **/
  for(var i = 0; i < 9; i++) {
    var j = "381246705".charAt(i);
    if(i == 4) {
      document.write(tin_pan[j],dei_pan[houses_star.join("").indexOf("苪")],'：',qimen_gan_relation(tin_pan[j],dei_pan[houses_star.join("").indexOf("苪")]));
    } else {
      document.write(tin_pan[j],dei_pan[j],'：',qimen_gan_relation(tin_pan[j],dei_pan[j]));
    }
    if((i+1) % 3 == 0) 
      document.write("\r\n");
    else
      document.write("　");
  }
  document.write(tin_pan[1],dei_pan[4],'：',qimen_gan_relation(tin_pan[1],dei_pan[4]));
  document.write("\r\n");
  document.write("\r\n");
  /** 九遁/三詐五假格局 特殊格局提示 **/
  //dump_qimen_type_group(tin,dei,star,door,_god);
  dump_qimen_type_group(tin_pan,dei_pan,houses_star,house_door,god_pan);
  document.write("\r\n");
  document.write("\r\n");
  /** 行星位置 **/
  var _line = astro.relation.length / 4 + 1;
  for(var i = 0; i < _line; i++) {
    document.write(astro.relation.slice(i*4,i*4+4).join("　"),"\r\n");
  }
  /** 行星相位 **/
  var _line = astro.position.length / 4 + 1;
  for(var i = 0; i < _line; i++) {
    document.write(astro.position.slice(i*4,i*4+4).join("　"),"\r\n");
  }
  document.write("\r\n");
  document.write("</pre>","\r\n");
  return _p;
}
function LuiYin(y,m,d,h,i,s) {
  "use strict";
  var _output = new Object;
  //var d = new Date(); //當下
  //
  var jiqi = new JiQi();
  //var jtoday = date_to_julian_day2(d.getFullYear(),d.getMonth()+1,d.getDate()) + 
  //  date_to_julian_time(d.getHours(), d.getMinutes(), d.getSeconds());
  var jtoday = date_to_julian_day2(y,m,d) + 
    date_to_julian_time(h,i,s);
  
  var jqTime = new Array;
  jiqi.GetPureJQsinceSpring2(y,0,0,0,jqTime);  // 計算當年節氣(以立春日為新一年)
  if(jtoday < jqTime[0]) {
    jiqi.GetPureJQsinceSpring2(y-1,0,0,0,jqTime);  // 計算上一年節氣(以立春日為新一年)
  }
  document.write("<pre>");
  var jqpos = 0;  // 計算當前節氣
  for(var ii = 1; ii < 25; ii++) {
    if(jtoday < jqTime[ii]) {
      //document.write(d, "\t",jiqi.Jtime(false,jtoday),"\r\n");
      document.write(jiqi.Jtime(false,jtoday),"\r\n");
      document.write(QIMEN_STAR.Solar2Lunar(y,m,d,h,i,s),"\r\n");
      document.write("當前節氣: ",jiqi.jq0[ii-1],"\r\n");
      document.write(jiqi.Jtime(false,jqTime[ii-1]),"\r\n");
      document.write("\r\n");
      jqpos = ii - 1;
      break;
    }
  }
  // 起四柱
  //var fcol = jiqi.GetGZ(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(), d.getMinutes(), d.getSeconds());
  var fcol = jiqi.GetGZ(y,m,d,h,i,s);
  // 排四柱
  var tcol0 = new Array;
  var dcol0 = new Array;
  for(var i = 6; i > -1 ; i -= 2) tcol0.push(fcol[i]);
  for(var i = 7; i > -1 ; i -= 2) dcol0.push(fcol[i]);
  document.write("四柱:","\r\n");
  document.write("　日","\r\n");
  document.write(tcol0.join(""),"\r\n");
  document.write(dcol0.join(""),"\r\n");
  document.write("\r\n");
  // 計當下月將
  var _arrGen = new Array;
  for(var i = 2; i < 25; i+=2) {
    _arrGen.push(jqTime[i-1]);
  }
  var _gen = 0;
  
  for(var i = 0; i < 12; i++) {
    ////console.log(jiqi.jq0[(11-i)*2+1]);
    if(jtoday > _arrGen[11 - i]) {
      _gen = 11 - i;
      break;
    }
  }
  document.write("月將：","亥戌酉申未午巳辰卯寅丑子".charAt(_gen),"\r\n");
  // 月將加時
  var _ginmon = "子丑寅卯辰巳午未申酉戌亥".indexOf("亥戌酉申未午巳辰卯寅丑子".charAt(_gen));  // 找月將index
  var _gmonth = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[0]); //月將加時index
  var _gg = _ginmon - _gmonth;
  if(_gg < 0) _gg+= 12;
  var gnm = "子丑寅卯辰巳午未申酉戌亥子丑寅卯辰巳午未申酉戌亥".substr(_gg,12); // 月將加時天盤
  
  var _gen_text = "亥戌酉申未午巳辰卯寅丑子".charAt(_gen);
  var _dnt = gnm.indexOf(_gen_text);
  var day_night_tin = "卯辰巳午未申酉戌亥子丑寅";
  var day_night_tin = day_night_tin.indexOf("子丑寅卯辰巳午未申酉戌亥".charAt(_dnt));
  var tin_idx  = "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[1]);
  var help_man;
  if(day_night_tin < 6) { // 日貴人
    var help_man = "丑子亥亥丑子丑午巳巳".charAt(tin_idx);
  } else { //夜貴人
    var help_man = "未申酉酉未申未寅卯卯".charAt(tin_idx);
  }
  var help_man2;
  var _tmp  = gnm.indexOf(help_man); //console.log(gnm.charAt(_tmp));
  var _tmp2 = "子丑寅卯辰巳午未申酉戌亥".charAt(_tmp);
  var day_night_dei = "亥子丑寅卯辰巳午未申酉戌".indexOf(_tmp2);//console.log(_tmp2,":",day_night_dei);
  var _start_at = 12 - _tmp; if(_start_at == 0) _start_at = 12;
  //console.log(day_night_dei,': ',_start_at);
  if(day_night_dei < 6) { // 順貴人
    var help_man2 = "貴蛇朱合勾青空白常玄陰后貴蛇朱合勾青空白常玄陰后貴蛇朱合勾青空白常玄陰后".substr(_start_at, 12);
  } else { //逆貴人
    var help_man2 = "后陰玄常白空青勾合朱蛇貴后陰玄常白空青勾合朱蛇貴后陰玄常白空青勾合朱蛇貴".substr(_start_at-1, 12);
  }
  // 計天干
  var _tin_gan_idx = "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[1]);
  var _dei_chi_idx = "子丑寅卯辰巳午未申酉戌亥".indexOf(dcol0[1]);
  var _chun_sau = _tin_gan_idx - _dei_chi_idx;
  if(_chun_sau < 0) _chun_sau += 12;
  _chun_sau = "子 戌 申 午 辰 寅".charAt(_chun_sau);
  var _tin_gan = "甲乙丙丁戊己庚辛壬癸　　甲乙丙丁戊己庚辛壬癸　　".substr(12 - gnm.indexOf(_chun_sau),12);
  //
  _output.helpMan   = help_man2;
  _output.genOnTime = gnm;
  // 
  //document.write("貴人：",help_man2,"\r\n");
  //document.write("天干：",_tin_gan,"\r\n");
  //document.write("加時：",gnm,"\r\n");
  //document.write("天盤：",gnm,"\r\n")
  //document.write("地盤：","子丑寅卯辰巳午未申酉戌亥","\r\n");
  //document.write("\r\n");
  
  document.write('　',help_man2.substr(5,4),'　',"\r\n");
  document.write('　',gnm.substr(5,4),'　',"\r\n");
  document.write(help_man2[4],gnm[4],'　　',gnm[9],help_man2[9],"\r\n");
  document.write(help_man2[3],gnm[3],'　　',gnm[10],help_man2[10],"\r\n");
  document.write('　',gnm[2],gnm[1],gnm[0],gnm[11],'　',"\r\n");
  document.write('　',help_man2[2],help_man2[1],help_man2[0],help_man2[11],'　',"\r\n");
  document.write("\r\n");
  // 定六親
  var _tin_gan_elem = "木木火火土土金金水水".charAt("甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[1]));
  var _dei_zhi_5elem = "水土木木土火火土金金土水";
  var _5elem_relation = "兄子財官父";
  var _5elem = "木火土金水木火土金水";_5elem = _5elem.substr(_5elem.indexOf(_tin_gan_elem),5)
  //起四課
  var _di4 = "甲乙丙丁戊己庚辛壬癸".indexOf(tcol0[1]);
  var _out0 = new Array;
  var _out1 = new Array;
  _out0.push(tcol0[1]);
  var _tmp = "寅辰巳未巳未申戌亥丑".charAt(_di4);
  _out1.push(gnm.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_tmp)));
  _out0.unshift(_out1[0]);
  _out1.unshift(gnm.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_out0[0])));
  _out0.unshift(dcol0[1]);
  _out1.unshift(gnm.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_out0[0])));
  _out0.unshift(_out1[0]);
  _out1.unshift(gnm.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_out0[0])));
  //document.write("起四課","\r\n");
  
  document.write('　',
    help_man2.charAt(gnm.indexOf(_out1[0])),
    help_man2.charAt(gnm.indexOf(_out1[1])),
    help_man2.charAt(gnm.indexOf(_out1[2])),
    help_man2.charAt(gnm.indexOf(_out1[3])),
    "\r\n"
    // end console log
    );
  /*
  document.write('　',
    _5elem_relation.charAt(_5elem.indexOf(_dei_zhi_5elem.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_out1[0])))),
    _5elem_relation.charAt(_5elem.indexOf(_dei_zhi_5elem.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_out1[1])))),
    _5elem_relation.charAt(_5elem.indexOf(_dei_zhi_5elem.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_out1[2])))),
    _5elem_relation.charAt(_5elem.indexOf(_dei_zhi_5elem.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_out1[3])))),
    "\r\n"
    // end console log
    );
  */
  document.write('　',_out1.join(""),"\r\n");
  document.write('　',_out0.join(""),"\r\n");
  _output.four = [_out1.join(""),_out0.join("")];
  document.write("\r\n");
  //發三傳
  var _three = luiyin_720(fcol.substr(4,2),"子丑寅卯辰巳午未申酉戌亥".indexOf(_out1[3]));
  _output.three = _three;
  _output.three_gan = new Array;
  _output.three_relation = new Array;
  _output.three_helper = new Array;
  document.write('　',"發三傳",_three.substr(3),"\r\n");
  for(var i = 0; i < 3; i++) {
    document.write('　',
      _5elem_relation.charAt(_5elem.indexOf(_dei_zhi_5elem.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_three[i])))),
      _tin_gan.charAt(gnm.indexOf(_three[i])),
      _three[i],
      help_man2.charAt(gnm.indexOf(_three[i])),
      "\r\n");
    _output.three_gan.push(
      _tin_gan.charAt(gnm.indexOf(_three[i]))
      );
    _output.three_relation.push(
      _5elem_relation.charAt(_5elem.indexOf(_dei_zhi_5elem.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_three[i]))))
      );
    _output.three_helper.push(
      help_man2.charAt(gnm.indexOf(_three[i]))
      );
  }
  /*****
  document.write('　',
    _5elem_relation.charAt(_5elem.indexOf(_dei_zhi_5elem.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_three[1])))),
    _tin_gan.charAt(gnm.indexOf(_three[1])),
    _three[1],
    help_man2.charAt(gnm.indexOf(_three[1])),
    "\r\n");
  document.write('　',
    _5elem_relation.charAt(_5elem.indexOf(_dei_zhi_5elem.charAt("子丑寅卯辰巳午未申酉戌亥".indexOf(_three[2])))),
    _tin_gan.charAt(gnm.indexOf(_three[2])),
    _three[2],
    help_man2.charAt(gnm.indexOf(_three[2])),
    "\r\n");
  *****/
  // 完結
  document.write("</pre>","\r\n");
  return _output;
}
/** 奇門九遁及其他格局計算 **/
function dump_qimen_type_group(tin,dei,star,_door,_god) {
  "use strict";
  var _d = new Array;
  for(var i = 0; i < 9; i++)
    _d.push(dei[i]);
  _d[4] = dei[tin.indexOf(_d[1])];
  //var _d = dei.slice(); _d[4] = dei[tin.indexOf(_d[1])];
  var god = _god.slice(); god[4] = god[tin.indexOf(_d[1])];
  var door = _door.slice(); door[4] = door[tin.indexOf(_d[1])];
  for(var i = 0; i < 9; i++) {
    //console.log(tin[i], _d[i], star[i], door[i], god[i]);
    if(tin[i] == '丙' && door[i]== '生' && _d[i] =='丁') document.write(i+1,':','天遁　');
    if(tin[i] == '乙' && door[i]== '開' && _d[i] =='己') document.write(i+1,':','地遁　');
    if(tin[i] == '丁' && door[i]== '休' && god[i] =='陰') document.write(i+1,':','人遁　');
    if(tin[i] == '乙' && "開休生".indexOf(door[i]) > -1 && i == 3) document.write(i+1,':','風遁　');
    if(tin[i] == '乙' && "開休生".indexOf(door[i]) > -1 && _d[i] == '辛') document.write(i+1,':','雲遁　');
    if(tin[i] == '乙' && "開休生".indexOf(door[i]) > -1 && (i == 0 || _d[i] == '癸')) document.write(i+1,':','龍遁　');
    if(tin[i] == '乙' && "休生".indexOf(door[i])   > -1 && (_d[i] == '辛' && 7)) document.write(i+1,':','虎遁　');
    if(tin[i] == '庚' && door[i] == '開' && i == 6) document.write(i+1,':','虎遁　');
    if(tin[i] == '丙' && door[i] == '生' && god[i] == '天') document.write(i+1,':','神遁　');
    if(tin[i] == '丁' && '杜開'.indexOf(door[i]) > -1 && god[i] == '地') document.write(i+1,':','鬼遁　');
    // 三詐
    if("開休生".indexOf(door[i]) > -1 && "乙丙丁".indexOf(tin[i]) > -1 && god[i] == '陰') document.write(i+1,':','真詐　');
    if("開休生".indexOf(door[i]) > -1 && "乙丙丁".indexOf(tin[i]) > -1 && god[i] == '合') document.write(i+1,':','休詐　');
    if("開休生".indexOf(door[i]) > -1 && "乙丙丁".indexOf(tin[i]) > -1 && god[i] == '地') document.write(i+1,':','重詐　');
    // 五假
    if(door[i] == '景' &&　"乙丙丁".indexOf(tin[i]) > -1 && god[i] == '天') document.write(i+1,':','天假　');
    if(door[i] == '杜' &&　"丁己癸".indexOf(tin[i]) > -1 && (god[i] == '地' || god[i] == '陰' || god[i] == '合')) document.write(i+1,':','地假　');
    if(door[i] == '驚' &&　tin[i] == '壬' && god[i] == '天') document.write(i+1,':','人假　');
    if(door[i] == '傷' &&　"丁己癸".indexOf(tin[i]) > -1 && god[i] == '地') document.write(i+1,':','神假　');
    if(door[i] == '傷' &&　"丁己癸".indexOf(tin[i]) > -1 && god[i] == '合') document.write(i+1,':','物假　');
    if(door[i] == '死' &&　"丁己癸".indexOf(tin[i]) > -1 && god[i] == '地') document.write(i+1,':','鬼假　');
  }
}
//document.write('<pre>參星',"\r\n");
//document.write(genResult(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds()))
//document.write('</pre>',"\r\n");

/** 神煞計算 - 計年干支 - 輸出地支 **/
function _god_effect_year(fcol) {
  var dei_zhi = "子丑寅卯辰巳午未申酉戌亥";   // 歲支
  var yuet_kin = "寅卯辰巳午未申酉戌亥子丑";  // 月建
  var yat_gon = "甲乙丙丁戊己庚辛壬癸";   // 日干
  var yat_ji  = "子丑寅卯辰巳午未申酉戌亥";   // 日支
  var out = new Array;
  //歲支
  out['龍德']   = "未申酉戌亥子丑寅卯辰巳午".charAt(dei_zhi.indexOf(fcol[1]));
  out['金匱']   = "子酉午卯子酉午卯子酉午卯".charAt(dei_zhi.indexOf(fcol[1]));
  out['將星']   = "子酉午卯子酉午卯子酉午卯".charAt(dei_zhi.indexOf(fcol[1]));
  out['紅鸞']   = "卯寅丑子亥戌酉申未午巳辰".charAt(dei_zhi.indexOf(fcol[1]));
  out['天狗']   = "戌亥子丑寅卯辰巳午未申酉".charAt(dei_zhi.indexOf(fcol[1]));
  out['勾絞']   = "卯辰巳午未申酉戌亥子丑寅".charAt(dei_zhi.indexOf(fcol[1]));
  out['歲破']   = "午未申酉戌亥子丑寅卯辰巳".charAt(dei_zhi.indexOf(fcol[1]));
  out['破碎']   = "午未申酉戌亥子丑寅卯辰巳".charAt(dei_zhi.indexOf(fcol[1]));
  out['大耗']   = "午未申酉戌亥子丑寅卯辰巳".charAt(dei_zhi.indexOf(fcol[1]));
  out['五鬼']   = "辰巳午未申酉戌亥子丑寅卯".charAt(dei_zhi.indexOf(fcol[1]));
  out['官符']   = "辰巳午未申酉戌亥子丑寅卯".charAt(dei_zhi.indexOf(fcol[1]));
  out['桃花']   = "酉午卯子酉午卯子酉午卯子".charAt(dei_zhi.indexOf(fcol[1]));
  out['血刃']   = "戌酉申未午巳辰卯寅丑子亥".charAt(dei_zhi.indexOf(fcol[1]));
  //
  var _out = new Array;
  for(var i = 0; i < 12; i++) _out[yat_ji[i]] = new Array;
  for(var o in out) {
    if(out[o] == '　') continue;
    if(o.length < 3)
      _out[out[o]].push(o+'　');
    else
      _out[out[o]].push(o.substr(0,3));
  }
  return _out;
}
/** 神煞計算 - 計月干支 - 輸出天干 **/
function _god_effect_month_gan(fcol) {
  var dei_zhi = "子丑寅卯辰巳午未申酉戌亥";   // 歲支
  var yuet_kin = "寅卯辰巳午未申酉戌亥子丑";  // 月建
  var yat_gon = "甲乙丙丁戊己庚辛壬癸";   // 日干
  var yat_ji  = "子丑寅卯辰巳午未申酉戌亥";   // 日支
  var out = new Array;
  //歲支
  out['天德']   = "己庚丁甲壬辛辛甲癸　丙乙".charAt(dei_zhi.indexOf(fcol[3]));
  out['月德']   = "壬庚丙甲壬庚丙甲壬庚丙甲".charAt(dei_zhi.indexOf(fcol[3]));
  //
  var _out = new Array;
  for(var i = 0; i < 10; i++) _out[yat_gon[i]] = new Array;
  for(var o in out) {
    if(out[o] == '　') continue;
    if(o.length < 3)
      _out[out[o]].push(o+'　');
    else
      _out[out[o]].push(o.substr(0,3));
  }
  return _out;
}
/** 神煞計算 - 計月干支 - 輸出地支 **/
function _god_effect_month_ji(fcol) {
  var dei_zhi = "子丑寅卯辰巳午未申酉戌亥";   // 歲支
  var yuet_kin = "寅卯辰巳午未申酉戌亥子丑";  // 月建
  var yat_gon = "甲乙丙丁戊己庚辛壬癸";   // 日干
  var yat_ji  = "子丑寅卯辰巳午未申酉戌亥";   // 日支
  var out = new Array;
  //月支
  out['天德']   = "　　　　　　　　　寅　　".charAt(dei_zhi.indexOf(fcol[3]));
  out['血刃']   = "午子丑未寅申卯酉辰戌巳亥".charAt(dei_zhi.indexOf(fcol[3]));
  //
  var _out = new Array;
  for(var i = 0; i < 12; i++) _out[yat_ji[i]] = new Array;
  for(var o in out) {
    if(out[o] == '　') continue;
    if(o.length < 3)
      _out[out[o]].push(o+'　');
    else
      _out[out[o]].push(o.substr(0,3));
  }
  return _out;
}
/** 神煞計算 - 計日干支-地支輸出 **/
function _god_effect_day_gan(fcol) {
  var dei_zhi = "子丑寅卯辰巳午未申酉戌亥";   // 歲支
  var yuet_kin = "寅卯辰巳午未申酉戌亥子丑";  // 月建
  var yat_gon = "甲乙丙丁戊己庚辛壬癸";   // 日干
  var yat_ji  = "子丑寅卯辰巳午未申酉戌亥";   // 日支
  var out = new Array;
  // 日煞 - 日干
  out['天財']    = "戊己庚辛壬癸甲乙丙丁".charAt(yat_gon.indexOf(fcol[4]));
  //
  var _out = new Array;
  for(var i = 0; i < 10; i++) _out[yat_gon[i]] = new Array;
  for(var o in out) {
    if(out[o] == '　') continue;
    _out[ out[o]].push(o.substr(0,2)+'　');
  }
  return _out;
}
/** 神煞計算 - 計日干支-地支輸出 **/
function _god_effect_day_ji(fcol) {
  var dei_zhi = "子丑寅卯辰巳午未申酉戌亥";   // 歲支
  var yuet_kin = "寅卯辰巳午未申酉戌亥子丑";  // 月建
  var yat_gon = "甲乙丙丁戊己庚辛壬癸";   // 日干
  var yat_ji  = "子丑寅卯辰巳午未申酉戌亥";   // 日支
  var out = new Array;
  // 日煞 - 日干
  out['天乙1']   = "丑子亥戌丑子丑午卯卯".charAt(yat_gon.indexOf(fcol[4]));
  out['天乙2']   = "未申酉酉未申未寅巳巳".charAt(yat_gon.indexOf(fcol[4]));
  out['文昌']    = "巳午申酉申酉亥子寅卯".charAt(yat_gon.indexOf(fcol[4]));
  out['祿神']    = "寅卯巳午巳午申丑亥子".charAt(yat_gon.indexOf(fcol[4]));
  out['羊刃']    = "卯辰午未午未酉戌子丑".charAt(yat_gon.indexOf(fcol[4]));
  out['紅豔1']   = "申申寅未辰辰戌酉子申".charAt(yat_gon.indexOf(fcol[4]));
  out['紅豔2']   = "午午　　　　　　　　".charAt(yat_gon.indexOf(fcol[4]));
  out['學堂']    = "亥午寅酉寅酉巳子申卯".charAt(yat_gon.indexOf(fcol[4]));
  out['流霞']    = "酉戌未申巳午辰卯亥寅".charAt(yat_gon.indexOf(fcol[4]));
  out['飛刃']    = "酉戌子丑子丑卯辰午未".charAt(yat_gon.indexOf(fcol[4]));
  //out['天財']    = "戊己庚辛壬癸甲乙丙丁".charAt(yat_gon.indexOf(fcol[4]));
  out['金輿']    = "辰巳未申未申戌亥丑寅".charAt(yat_gon.indexOf(fcol[4]));
  // 日支神煞表
  out['華蓋']  = "辰丑戌未辰丑戌未辰丑戌未".charAt(yat_ji.indexOf(fcol[5]));
  out['將星']  = "子酉午卯子酉午卯子酉午卯".charAt(yat_ji.indexOf(fcol[5]));
  out['驛馬']  = "寅亥申巳寅亥申巳寅亥申巳".charAt(yat_ji.indexOf(fcol[5]));
  out['桃花']  = "酉午卯子酉午卯子酉午卯子".charAt(yat_ji.indexOf(fcol[5]));
  out['血刃']  = "戌酉申未午巳辰卯寅丑子亥".charAt(yat_ji.indexOf(fcol[5]));
  out['孤辰']  = "寅寅巳巳巳申申申亥亥亥寅".charAt(yat_ji.indexOf(fcol[5]));
  out['寡宿']  = "戌戌丑丑丑辰辰辰未未未戌".charAt(yat_ji.indexOf(fcol[5]));
  out['喪門']  = "寅卯辰巳午未申酉戌亥子丑".charAt(yat_ji.indexOf(fcol[5]));
  out['劫煞']  = "巳寅亥申巳寅亥申巳寅亥申".charAt(yat_ji.indexOf(fcol[5]));
  out['隔角']  = "寅卯辰巳午未申酉戌亥子丑".charAt(yat_ji.indexOf(fcol[5]));
  out['亡神']  = "亥申巳寅亥申巳寅亥申巳寅".charAt(yat_ji.indexOf(fcol[5]));
  //
  var _out = new Array;
  for(var i = 0; i < 12; i++) _out[yat_ji[i]] = new Array;
  for(var o in out) {
    if(out[o] == '　') continue;
    _out[ out[o]].push(o.substr(0,2)+'　');
  }
  return _out;
}
/** 計算奇門天地盤十干生剋 **/
function qimen_gan_relation(tin,dei) {
  var tin_dei = {"\u5e9a\u5df1": "\u592a\u767d\u5927\u5211", "\u5df1\u620a": "\u72ac\u9047\u9752\u9f8d", "\u4e01\u4e01": "\u5947\u5165\u592a\u9670", "\u4e01\u7678": "\u6731\u96c0\u6295\u6c5f", "\u7678\u4e19": "\u83ef\u84cb\u6096\u5e2b", "\u8f9b\u4e01": "\u7344\u795e\u5f97\u5947", "\u58ec\u58ec": "\u86c7\u5165\u5730\u7f85", "\u620a\u8f9b": "\u9752\u9f8d\u6298\u8db3", "\u4e19\u4e01": "\u661f\u5947\u6731\u96c0", "\u4e59\u8f9b": "\u9752\u9f8d\u9003\u8d70", "\u8f9b\u4e19": "\u5e72\u5408\u6096\u5e2b", "\u58ec\u7678": "\u5e7c\u5973\u5978\u6deb", "\u4e19\u4e19": "\u6708\u5947\u6096\u5e2b", "\u58ec\u8f9b": "\u87a3\u86c7\u76f8\u7e8f", "\u4e59\u58ec": "\u65e5\u5947\u5165\u5730", "\u7678\u4e59": "\u83ef\u84cb\u9022\u661f", "\u58ec\u620a": "\u5c0f\u86c7\u5316\u9f8d", "\u5df1\u8f9b": "\u6e38\u9b42\u5165\u5893", "\u4e01\u4e19": "\u661f\u96a8\u6708\u8f49", "\u4e19\u58ec": "\u706b\u5165\u5929\u7f85", "\u7678\u7678": "\u5929\u7db2\u56db\u5f35", "\u7678\u4e01": "\u87a3\u86c7\u592d\u77ef", "\u5df1\u4e19": "\u706b\u6096\u5730\u6236", "\u4e59\u5e9a": "\u65e5\u5947\u88ab\u5211", "\u8f9b\u5e9a": "\u767d\u864e\u51fa\u529b", "\u58ec\u4e01": "\u5e72\u5408\u86c7\u5211", "\u5e9a\u7678": "\u592a\u767d\u6c96\u5211", "\u8f9b\u620a": "\u56f0\u9f8d\u88ab\u50b7", "\u4e59\u4e01": "\u5947\u5100\u76f8\u4f50", "\u7678\u5e9a": "\u592a\u767d\u5165\u7db2", "\u5df1\u5e9a": "\u5211\u683c\u8fd4\u540d", "\u7678\u8f9b": "\u7db2\u84cb\u5929\u7262", "\u5e9a\u58ec": "\u592a\u767d\u9000\u4f4d", "\u4e19\u5e9a": "\u8367\u5165\u592a\u767d", "\u4e59\u4e19": "\u5947\u5100\u9806\u9042", "\u4e01\u8f9b": "\u7389\u5973\u4f0f\u864e", "\u7678\u620a": "\u5929\u4e59\u6703\u5408", "\u5df1\u7678": "\u5730\u5211\u7384\u6b66", "\u4e01\u5e9a": "\u7389\u5973\u5211\u6bba", "\u58ec\u4e19": "\u6c34\u86c7\u5165\u706b", "\u620a\u4e59": "\u9752\u9f8d\u548c\u6703", "\u4e19\u7678": "\u83ef\u84cb\u6096\u5e2b", "\u5e9a\u4e59": "\u592a\u767d\u9022\u661f", "\u5e9a\u620a": "\u5929\u4e59\u4f0f\u5bae", "\u5df1\u5df1": "\u5730\u6236\u9022\u9b3c", "\u620a\u58ec": "\u9752\u9f8d\u7834\u7344", "\u620a\u620a": "\u9752\u9f8d\u4f0f\u541f", "\u8f9b\u58ec": "\u51f6\u86c7\u5165\u7344", "\u4e19\u5df1": "\u706b\u6096\u5165\u5211", "\u4e59\u7678": "\u83ef\u84cb\u9022\u661f", "\u58ec\u5e9a": "\u592a\u767d\u64d2\u86c7", "\u4e59\u620a": "\u9670\u5bb3\u967d\u9580", "\u5df1\u4e01": "\u6731\u96c0\u5165\u5893", "\u8f9b\u4e59": "\u767d\u864e\u7316\u72c2", "\u5e9a\u8f9b": "\u592a\u767d\u91cd\u92d2", "\u4e01\u58ec": "\u4e94\u795e\u4e92\u5408", "\u620a\u7678": "\u9752\u9f8d\u83ef\u84cb", "\u4e19\u4e59": "\u65e5\u6708\u4e26\u884c", "\u5e9a\u5e9a": "\u592a\u767d\u540c\u5bae", "\u7678\u58ec": "\u5fa9\u898b\u87a3\u86c7", "\u4e19\u8f9b": "\u65e5\u6708\u76f8\u6703", "\u8f9b\u7678": "\u5929\u7262\u83ef\u84cb", "\u4e01\u4e59": "\u7389\u5973\u5947\u751f", "\u4e59\u5df1": "\u65e5\u5947\u5165\u5893", "\u5df1\u4e59": "\u5893\u795e\u4e0d\u660e", "\u620a\u4e01": "\u9752\u9f8d\u8000\u660e", "\u8f9b\u8f9b": "\u4f0f\u541f\u5929\u5ead", "\u8f9b\u5df1": "\u5165\u7344\u81ea\u5211", "\u4e59\u4e59": "\u65e5\u5947\u4f0f\u541f", "\u4e01\u620a": "\u9752\u9f8d\u8f49\u5149", "\u7678\u5df1": "\u83ef\u84cb\u5730\u6236", "\u5df1\u58ec": "\u5730\u7db2\u9ad8\u5f35", "\u620a\u5df1": "\u8cb4\u4eba\u5165\u7344", "\u4e01\u5df1": "\u706b\u5165\u52fe\u9673", "\u4e19\u620a": "\u98db\u9ce5\u8dcc\u7a74", "\u58ec\u5df1": "\u53cd\u541f\u86c7\u5211", "\u58ec\u4e59": "\u5c0f\u86c7\u5f97\u52e2", "\u5e9a\u4e19": "\u592a\u767d\u5165\u8367", "\u620a\u5e9a": "\u503c\u7b26\u98db\u5bae", "\u5e9a\u4e01": "\u592a\u767d\u53d7\u5211", "\u620a\u4e19": "\u9752\u9f8d\u8fd4\u9996"};
  return tin_dei[tin+dei];
}
/** 十二長生 **/
function twelev_life(fcol) {
  // to be coded
}
/** 計算法達星限 **/
function astro_firdaria(yy,mm,dd,hh,ii,ss) {
  "use strict";
  document.write("<pre>","\r\n");
  var jq = new JiQi();
  var jtoday = date_to_julian_day2(yy,mm,dd) + date_to_julian_time(hh,ii,ss);
  var period = {'日':10,'金':8,'水':13,'月':9,'土':11,'木':12,'火':7};
  if(hh >=5 && hh <= 17) {
    var period_start = ['日','金','水','月','土','木','火'];
  } else {
    var period_start = ['月','土','木','火','日','金','水'];
  }
  document.write("法達星限計算：","\r\n");
  var _current_day = jtoday;
  var current_period = period_start.slice(0);
  for(var i = 0; i < 7; i++) {
    var active_day  = period[current_period[0]] * 365.25;
    var average_day = active_day/7;
    document.write("大期: ",current_period[0],"\r\n");
    for(var j = 0; j < 7; j++) {
      document.write(current_period[0],':',current_period[j],"\t",jq.Jtime(false,_current_day),"\r\n");
      _current_day += average_day;
    }
    current_period.push(current_period.shift());
  }
  document.write("大期: 羅喉(北交點)",jq.Jtime(false,_current_day),"\r\n");
  _current_day += 365.25 * 3;
  document.write("大期: 計都(南交點)",jq.Jtime(false,_current_day),"\r\n");
  _current_day += 365.25 * 2;
  document.write("</pre>","\r\n");
}
/** 神煞計算 - 神煞三百全套 **/
function _god_effect(fcol) {
  var dei_zhi = "子丑寅卯辰巳午未申酉戌亥";   // 歲支
  var yuet_kin = "寅卯辰巳午未申酉戌亥子丑";  // 月建
  var yat_gon = "甲乙丙丁戊己庚辛壬癸";   // 日干
  var yat_ji  = "子丑寅卯辰巳午未申酉戌亥";   // 日支
  var out = new Array;
  //歲支
  out['太歲']   = "子丑寅卯辰巳午未申酉戌亥".charAt(dei_zhi.indexOf(fcol[1]));
  out['大將軍'] = "酉酉子子子卯卯卯午午午酉".charAt(dei_zhi.indexOf(fcol[1]));
  out['歲破']   = "午未申酉戌亥子丑寅卯辰巳".charAt(dei_zhi.indexOf(fcol[1]));
 // out['大耗']   = "午未申酉戌亥子丑寅卯辰巳".charAt(dei_zhi.indexOf(fcol[1]));
  out['小耗']   = "巳午未申酉戌亥子丑寅卯辰".charAt(dei_zhi.indexOf(fcol[1]));
  //out['死符']   = "巳午未申酉戌亥子丑寅卯辰".charAt(dei_zhi.indexOf(fcol[1]));
  out['喪門']   = "寅卯辰巳午未申酉戌亥子丑".charAt(dei_zhi.indexOf(fcol[1]));
  out['弔客']   = "戌亥子丑寅卯辰巳午未申酉".charAt(dei_zhi.indexOf(fcol[1]));
  //out['太陰']   = "戌亥子丑寅卯辰巳午未申酉".charAt(dei_zhi.indexOf(fcol[1]));
  out['病符']   = "亥子丑寅卯辰巳午未申酉戌".charAt(dei_zhi.indexOf(fcol[1]));
  out['官符']   = "辰巳午未申酉戌亥子丑寅卯".charAt(dei_zhi.indexOf(fcol[1]));
  //out['畜官']   = "辰巳午未申酉戌亥子丑寅卯".charAt(dei_zhi.indexOf(fcol[1]));
  out['白虎']   = "申酉戌亥子丑寅卯辰巳午未".charAt(dei_zhi.indexOf(fcol[1]));
  out['歲刑']   = "卯戌巳子辰申午丑寅酉未亥".charAt(dei_zhi.indexOf(fcol[1]));
  out['黃旛']   = "辰丑戌未辰丑戌未辰丑戌未".charAt(dei_zhi.indexOf(fcol[1]));
  //out['華蓋']   = "辰丑戌未辰丑戌未辰丑戌未".charAt(dei_zhi.indexOf(fcol[1]));
  out['豹尾']   = "戌未辰丑戌未辰丑戌未辰丑".charAt(dei_zhi.indexOf(fcol[1]));
  out['歲墓']   = "未申酉戌亥子丑寅卯辰巳午".charAt(dei_zhi.indexOf(fcol[1]));
  out['大禍']   = "卯戌巳子未寅酉辰亥午丑申".charAt(dei_zhi.indexOf(fcol[1]));
  out['六害']   = "卯子酉午卯子酉午卯子酉午".charAt(dei_zhi.indexOf(fcol[1]));
  out['歲馬']   = "寅亥申巳寅亥申巳寅亥申巳".charAt(dei_zhi.indexOf(fcol[1]));
  out['劫煞']   = "巳寅亥申巳寅亥申巳寅亥申".charAt(dei_zhi.indexOf(fcol[1]));
  out['災煞']   = "午卯子酉午卯子酉午卯子酉".charAt(dei_zhi.indexOf(fcol[1]));
  out['歲煞']   = "未辰丑戌未辰丑戌未辰丑戌".charAt(dei_zhi.indexOf(fcol[1]));
  //out['天煞']   = "未辰丑戌未辰丑戌未辰丑戌".charAt(dei_zhi.indexOf(fcol[1]));
  out['地煞']   = "申巳寅亥申巳寅亥申巳寅亥".charAt(dei_zhi.indexOf(fcol[1]));
  out['咸池']   = "酉午卯子酉午卯子酉午卯子".charAt(dei_zhi.indexOf(fcol[1]));
  out['亡神']   = "亥申巳寅亥申巳寅亥申巳寅".charAt(dei_zhi.indexOf(fcol[1]));
  out['將星']   = "子酉午卯子酉午卯子酉午卯".charAt(dei_zhi.indexOf(fcol[1]));
  out['攀鞍']   = "丑戌未辰丑戌未辰丑戌未辰".charAt(dei_zhi.indexOf(fcol[1]));
  out['六合']   = "卯辰巳午未申酉戌亥子丑寅".charAt(dei_zhi.indexOf(fcol[1]));
  out['龍德']   = "未申酉戌亥子丑寅卯辰巳午".charAt(dei_zhi.indexOf(fcol[1]));
  out['福德']   = "酉戌亥子丑寅卯辰巳午未申".charAt(dei_zhi.indexOf(fcol[1]));
  out['太陽']   = "丑寅卯辰巳午未申酉戌亥子".charAt(dei_zhi.indexOf(fcol[1]));
  //out['青龍']   = "丑寅卯辰巳午未申酉戌亥子".charAt(dei_zhi.indexOf(fcol[1]));
  // 月建
  out['天喜']   = "戌戌戌丑丑丑辰辰辰未未未".charAt(yuet_kin.indexOf(fcol[3]));
  out['三丘']   = "丑丑丑辰辰辰未未未戌戌戌".charAt(yuet_kin.indexOf(fcol[3]));
  //out['關神']   = "丑丑丑辰辰辰未未未戌戌戌".charAt(yuet_kin.indexOf(fcol[3]));
  //out['管神']   = "丑丑丑辰辰辰未未未戌戌戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['皇書']   = "寅寅寅巳巳巳申申申亥亥亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['賊神']   = "卯卯卯午午午酉酉酉子子子".charAt(yuet_kin.indexOf(fcol[3]));
  out['奸神']   = "寅寅寅亥亥亥申申申巳巳巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['遊神']   = "丑丑丑子子子亥亥亥戌戌戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['戲神']   = "巳巳巳子子子酉酉酉辰辰辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['憂神']   = "丑丑丑子子子戌戌戌亥亥亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['孤神']   = "巳巳巳申申申亥亥亥寅寅寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['寡宿']   = "丑丑丑辰辰辰未未未戌戌戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['五墓']   = "未未未戌戌戌丑丑丑辰辰辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['天車']   = "巳巳巳辰辰辰未未未酉酉酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['地獄']   = "未未未戌戌戌辰辰辰丑丑丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['四廢']   = "酉酉酉子子子卯卯卯午午午".charAt(yuet_kin.indexOf(fcol[3]));
  out['天耳']   = "戌戌戌丑丑丑辰辰辰未未未".charAt(yuet_kin.indexOf(fcol[3]));
  out['天目']   = "辰辰辰未未未戌戌戌丑丑丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['絕氣']   = "申申申亥亥亥寅寅寅巳巳巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['戰雄']   = "寅寅寅巳巳巳申申申亥亥亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['戰雌']   = "申申申亥亥亥寅寅寅巳巳巳".charAt(yuet_kin.indexOf(fcol[3]));
  //out['煞神']   = "申申申亥亥亥寅寅寅巳巳巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['浴盆']   = "辰辰辰未未未戌戌戌丑丑丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['火鬼']   = "午午午酉酉酉子子子卯卯卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['喪車']   = "酉酉酉子子子卯卯卯午午午".charAt(yuet_kin.indexOf(fcol[3]));
  out['哭神']   = "未未未戌戌戌丑丑丑辰辰辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['鑰神']   = "巳巳巳申申申亥亥亥寅寅寅".charAt(yuet_kin.indexOf(fcol[3]));
  //out['喝散']   = "巳巳巳申申申亥亥亥寅寅寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['吏神']   = "寅寅寅巳巳巳申申申亥亥亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['轉煞']   = "卯卯卯午午午酉酉酉子子子".charAt(yuet_kin.indexOf(fcol[3]));
  out['飛禍']   = "申申申寅寅寅巳巳巳亥亥亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['絲麻']   = "卯卯卯午午午酉酉酉子子子".charAt(yuet_kin.indexOf(fcol[3]));
  out['死別']   = "戌戌戌未未未辰辰辰丑丑丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['返魂']   = "亥亥亥寅寅寅申申申巳巳巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['梁神']   = "巳巳巳申申申亥亥亥寅寅寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['龍神']   = "辰辰辰未未未戌戌戌丑丑丑弓".charAt(yuet_kin.indexOf(fcol[3]));
  out['刀砧']   = "子子子卯卯卯午午午酉酉酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['奸盜']   = "卯卯卯午午午酉酉酉子子子".charAt(yuet_kin.indexOf(fcol[3]));
  //out['天轉(干)']   = "乙乙乙丙丙丙辛辛辛壬壬壬".charAt(yuet_kin.indexOf(fcol[3]));
  out['天轉(支)']   = "卯卯卯午午午酉酉酉子子子".charAt(yuet_kin.indexOf(fcol[3]));
  //out['地轉(干)']   = "辛辛辛戊戊戊癸癸癸丙丙丙".charAt(yuet_kin.indexOf(fcol[3]));
  out['地轉(支)']   = "卯卯卯午午午酉酉酉子子子".charAt(yuet_kin.indexOf(fcol[3]));
  out['天德']   = "未申亥戌亥寅丑寅巳辰巳申".charAt(yuet_kin.indexOf(fcol[3]));
  out['天德合'] = "亥　未巳　未巳　戌申　辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['月德']   = "巳寅亥申巳寅亥申巳寅亥申".charAt(yuet_kin.indexOf(fcol[3]));
  out['月德合'] = "戌未未辰戌未未辰戌未未辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['天解']   = "申未午巳辰卯寅丑子亥戌酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['地解']   = "申申酉酉戌戌亥亥午午未未".charAt(yuet_kin.indexOf(fcol[3]));
  out['解神']   = "申申戌戌子子寅寅辰辰午午".charAt(yuet_kin.indexOf(fcol[3]));
  out['會神']   = "未戌寅亥酉子丑午巳卯申辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['信神']   = "申戌寅丑亥辰巳未巳未申戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['生炁']   = "子丑寅卯辰巳午未申酉戌亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['死炁']   = "午未申酉戌亥子丑寅卯辰巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['死神']   = "巳午未申酉戌亥子丑寅卯辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['成神']   = "巳申亥寅巳申亥寅巳申亥寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['血支']   = "丑寅卯辰巳午未申酉戌亥子".charAt(yuet_kin.indexOf(fcol[3]));
  out['血忌']   = "丑未寅申卯酉辰戌巳亥午子".charAt(yuet_kin.indexOf(fcol[3]));
  out['飛魂']   = "亥子丑寅卯辰巳午未申酉戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['喪魄']   = "未辰丑戌未辰丑戌未辰丑戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['月厭']   = "戌酉申未午巳辰卯寅丑子亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['上喪']   = "辰未戌丑辰未戌丑辰未戌丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['下喪']   = "未辰丑戌未辰丑戌未辰丑戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['大時']   = "卯子酉午卯子酉午卯子酉午".charAt(yuet_kin.indexOf(fcol[3]));
  out['小時']   = "寅卯辰巳午未申酉戌亥子丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['破碎']   = "酉巳丑酉巳丑酉巳丑酉巳丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['歸忌']   = "丑寅子丑寅子丑寅子丑寅子".charAt(yuet_kin.indexOf(fcol[3]));
  out['往亡']   = "寅巳申亥卯午酉子辰未戌丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['飛廉']   = "戌巳午未寅卯辰亥子丑申酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['月刑']   = "巳子辰申午丑寅酉未亥卯戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['天賊']   = "辰酉寅未子巳戌卯申丑午亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['厭對']   = "辰卯寅丑子亥戌酉申未午巳".charAt(yuet_kin.indexOf(fcol[3]));
  //out['血光']   = "辰卯寅丑子亥戌酉申未午巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['月破']   = "申酉戌亥子丑寅卯辰巳午未".charAt(yuet_kin.indexOf(fcol[3]));
  out['大煞']   = "午卯子酉午卯子酉午卯子酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['遊禍']   = "巳寅亥申巳寅亥申巳寅亥申".charAt(yuet_kin.indexOf(fcol[3]));
  out['受死']   = "戌辰亥巳子午丑未寅申卯酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['月煞']   = "丑戌未辰丑戌未辰丑戌未辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['天鬼']   = "酉午卯子酉午卯子酉午卯子".charAt(yuet_kin.indexOf(fcol[3]));
  out['孝服']   = "午未申酉戌亥子丑寅卯辰巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['孝杖']   = "巳午未申酉戌亥子丑寅卯辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['天巫']   = "辰巳午未申酉戌亥子丑寅卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['迷惑']   = "丑戌未辰丑戌未辰丑戌未辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['相負']   = "亥亥丑丑卯卯巳巳未未酉酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['枉屈']   = "巳巳未未酉酉亥亥丑丑卯卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['瓦煞1']   = "巳子丑寅卯辰亥午未申酉戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['瓦煞2']   = "亥午未申酉戌巳子丑寅卯辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['門煞']   = "戌酉辰卯戌酉辰卯戌酉辰卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['夢神']   = "辰戌丑未辰戌丑未辰戌丑未".charAt(yuet_kin.indexOf(fcol[3]));
  out['五鬼']   = "午辰寅酉卯申丑巳子未亥戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['月鬼']   = "未辰丑戌未辰丑戌未辰丑戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['奸門']   = "申亥寅巳申亥寅巳申亥寅巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['桃花']   = "卯子酉午卯子酉午卯子酉午".charAt(yuet_kin.indexOf(fcol[3]));
  out['披麻']   = "子酉午卯子酉午卯子酉午卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['天馬']   = "午申戌子寅辰午申戌子寅辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['陽煞']   = "亥寅巳申亥寅巳申亥寅巳申".charAt(yuet_kin.indexOf(fcol[3]));
  out['陰煞']   = "巳辰卯寅丑子亥戌酉申未午".charAt(yuet_kin.indexOf(fcol[3]));
  out['書信']   = "酉戌亥子丑寅卯辰巳午未申".charAt(yuet_kin.indexOf(fcol[3]));
  //out['天機']   = "酉戌亥子丑寅卯辰巳午未申".charAt(yuet_kin.indexOf(fcol[3]));
  out['月害']   = "巳辰卯寅丑子亥戌酉申未午".charAt(yuet_kin.indexOf(fcol[3]));
  out['滅門']   = "亥午丑申卯戌巳子未寅酉辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['大禍']   = "巳子未寅酉辰亥午丑申卯戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['火光']   = "戌酉申未午巳辰卯寅丑子亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['火燭']   = "巳午未申酉戌亥子丑寅卯辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['雌虎']   = "辰巳午未申酉戌亥子丑寅卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['雨師']   = "子卯午酉子卯午酉子卯午酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['風伯']   = "申未什巳辰卯寅丑子亥戌酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['月合']   = "亥戌酉申未午巳辰卯寅丑子".charAt(yuet_kin.indexOf(fcol[3]));
  out['風煞']   = "寅丑子亥戌酉申未午巳辰卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['雨煞']   = "子丑寅卯辰巳午未申酉戌亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['天書']   = "戌亥子丑寅卯辰巳午未申酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['雷煞']   = "亥申巳寅亥申巳寅亥申巳寅".charAt(yuet_kin.indexOf(fcol[3]));
  //out['女災']   = "亥申巳寅亥申巳寅亥申巳寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['天火']   = "子卯午酉子卯午酉子卯午酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['月奸']   = "丑辰未戌丑辰未戌丑辰未戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['雷公']   = "卯子酉午卯子酉午卯子酉午".charAt(yuet_kin.indexOf(fcol[3]));
  out['天倉']   = "寅丑子亥戌酉申未午巳辰卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['天財']   = "辰午申戌子寅辰午申戌子寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['天詔']   = "亥子丑寅卯辰巳午未申酉戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['遊煞']   = "卯辰巳午未申酉戌亥子丑寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['天雞']   = "酉申未午巳辰卯寅丑子亥戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['謾語']   = "午未申酉戌亥子丑寅卯辰巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['天坑']   = "丑寅卯辰巳午未申酉戌亥子".charAt(yuet_kin.indexOf(fcol[3]));
  out['盜神']   = "卯午酉子卯午酉子卯午酉子".charAt(yuet_kin.indexOf(fcol[3]));
  out['邪神']   = "未午巳辰卯寅丑子亥戌酉申".charAt(yuet_kin.indexOf(fcol[3]));
  out['天廁']   = "寅巳申亥卯午酉子辰未戌丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['產煞']   = "寅巳申亥寅巳申亥寅巳申亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['劫煞']   = "亥申巳寅亥申巳寅亥申巳寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['大耗']   = "申酉戌亥子丑寅卯辰巳午未".charAt(yuet_kin.indexOf(fcol[3]));
  out['小耗']   = "未申酉戌亥子丑寅卯辰巳午".charAt(yuet_kin.indexOf(fcol[3]));
  out['皇恩']   = "未酉亥丑卯巳未酉亥丑卯巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['天盜']   = "寅亥申巳寅亥申巳寅亥申巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['亡神']   = "巳寅亥申巳寅亥申巳寅亥申".charAt(yuet_kin.indexOf(fcol[3]));
  out['火怪']   = "戌未辰丑戌未辰丑戌未辰丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['天醫']   = "辰巳午未申酉戌亥子丑寅卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['地醫']   = "戌亥子丑寅卯辰巳午未申酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['纏繞1']   = "申酉戌亥子丑寅卯辰巳午未".charAt(yuet_kin.indexOf(fcol[3]));
  out['纏繞2']   = "申未午巳辰卯寅丑子亥戌酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['天破']   = "午酉子卯午酉子卯午酉子卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['小煞']   = "丑戌未辰丑戌未辰丑戌未辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['枯骨']   = "未申酉戌亥子丑寅卯辰巳午".charAt(yuet_kin.indexOf(fcol[3]));
  out['瘟煞']   = "辰巳午未申酉戌亥子丑寅卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['兒煞']   = "亥子丑寅卯辰巳午未申酉戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['刑亡']   = "戌亥子丑申酉辰巳午未寅卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['道路']   = "申酉戌亥子丑寅卯辰巳午未".charAt(yuet_kin.indexOf(fcol[3]));
  out['天吏']   = "酉午卯子酉午卯子酉午卯子".charAt(yuet_kin.indexOf(fcol[3]));
  out['災煞']   = "子酉午卯子酉午卯子酉午卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['懸索']   = "卯子酉午卯子酉午卯子酉午".charAt(yuet_kin.indexOf(fcol[3]));
  out['天煞']   = "丑戌未辰丑戌未辰丑戌未辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['天咒']   = "酉午卯子酉午卯子酉午卯子".charAt(yuet_kin.indexOf(fcol[3]));
  out['墓門']   = "亥申巳寅亥申巳寅亥申巳寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['長繩']   = "酉午卯子酉午卯子酉午卯子".charAt(yuet_kin.indexOf(fcol[3]));
  out['木煞']   = "寅卯辰巳午未申酉戌亥子丑".charAt(yuet_kin.indexOf(fcol[3]));
  //out['天虎']   = "寅卯辰巳午未申酉戌亥子丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['天龍']   = "卯辰巳午未申酉戌亥子丑寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['厄煞']   = "巳午未申酉戌亥子丑寅卯辰".charAt(yuet_kin.indexOf(fcol[3]));
  //out['電煞']   = "巳午未申酉戌亥子丑寅卯辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['官符']   = "午未申酉戌亥子丑寅卯辰巳".charAt(yuet_kin.indexOf(fcol[3]));
  //out['畜官']   = "午未申酉戌亥子丑寅卯辰巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['井煞']   = "未申酉戌亥子丑寅卯辰巳午".charAt(yuet_kin.indexOf(fcol[3]));
  out['井煞']   = "未申酉戌亥子丑寅卯辰巳午".charAt(yuet_kin.indexOf(fcol[3]));
  out['天錢']   = "酉戌亥子丑寅卯辰巳午未申".charAt(yuet_kin.indexOf(fcol[3]));
  out['天愿']   = "戌亥子丑寅卯辰巳午未申酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['伏連']   = "亥子丑寅卯辰巳午未申酉戌".charAt(yuet_kin.indexOf(fcol[3]));
  //out['哭忌']   = "亥子丑寅卯辰巳午未申酉戌".charAt(yuet_kin.indexOf(fcol[3]));
  //out['病煞']   = "亥子丑寅卯辰巳午未申酉戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['佛煞']   = "丑寅卯辰巳午未申酉戌亥子".charAt(yuet_kin.indexOf(fcol[3]));
  //out['天牛']   = "丑寅卯辰巳午未申酉戌亥子".charAt(yuet_kin.indexOf(fcol[3]));
  out['天羊']   = "未申酉戌亥子丑寅卯辰巳午".charAt(yuet_kin.indexOf(fcol[3]));
  out['墳墓']   = "丑寅卯辰巳午未申酉戌亥子".charAt(yuet_kin.indexOf(fcol[3]));
  out['天猪']   = "亥戌酉申未午巳辰卯寅丑子".charAt(yuet_kin.indexOf(fcol[3]));
  out['天鼠']   = "子亥戌酉申未午巳辰卯寅丑".charAt(yuet_kin.indexOf(fcol[3]));
  //out['天視']   = "子亥戌酉申未午巳辰卯寅丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['天怪']   = "丑子亥戌酉申未午巳辰卯寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['燭命']   = "卯寅丑子亥戌酉申未午巳辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['地咒']   = "午巳辰卯寅丑子亥戌酉申未".charAt(yuet_kin.indexOf(fcol[3]));
  //out['破器']   = "午巳辰卯寅丑子亥戌酉申未".charAt(yuet_kin.indexOf(fcol[3]));
  out['陰奸']   = "未午巳辰卯寅丑子亥戌酉申".charAt(yuet_kin.indexOf(fcol[3]));
  out['天猴']   = "申未午巳辰卯寅丑子亥戌酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['軒轅']   = "酉申未午巳辰卯寅丑子亥戌".charAt(yuet_kin.indexOf(fcol[3]));
  //out['折傷']   = "酉申未午巳辰卯寅丑子亥戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['天狗']   = "戌酉申未午巳辰卯寅丑子亥".charAt(yuet_kin.indexOf(fcol[3]));
  //out['四足']   = "戌酉申未午巳辰卯寅丑子亥".charAt(yuet_kin.indexOf(fcol[3]));
  //out['石煞']   = "戌酉申未午巳辰卯寅丑子亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['白衣']   = "未辰丑未辰丑未辰丑未辰丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['華蓋']   = "戌未辰丑戌未辰丑戌未辰丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['天獄']   = "亥申巳寅亥申巳寅亥申巳寅".charAt(yuet_kin.indexOf(fcol[3]));
  //out['天網']   = "亥申巳寅亥申巳寅亥申巳寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['坑坎']   = "子酉午卯子酉午卯子酉午卯".charAt(yuet_kin.indexOf(fcol[3]));
  //out['山魈']   = "子酉午卯子酉午卯子酉午卯".charAt(yuet_kin.indexOf(fcol[3]));
  //out['鏡煞']   = "子酉午卯子酉午卯子酉午卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['五盜']   = "丑戌未辰丑戌未辰丑戌未辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['邪鬼']   = "辰丑戌未辰丑戌未辰丑戌未".charAt(yuet_kin.indexOf(fcol[3]));
  out['伏骨']   = "午卯子酉午卯子酉午卯子酉".charAt(yuet_kin.indexOf(fcol[3]));
  out['穢煞']   = "未辰丑戌未辰丑戌未辰丑戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['天旺']   = "巳申亥寅巳申亥寅巳申亥寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['爐煞']   = "未戌丑辰未戌丑辰未戌丑辰".charAt(yuet_kin.indexOf(fcol[3]));
  //out['獄神']   = "未戌丑辰未戌丑辰未戌丑辰".charAt(yuet_kin.indexOf(fcol[3]));
  out['天信']   = "酉子卯午酉子卯午酉子卯午".charAt(yuet_kin.indexOf(fcol[3]));
  out['反激']   = "戌丑辰未戌丑辰未戌丑辰未".charAt(yuet_kin.indexOf(fcol[3]));
  out['釜神']   = "寅巳申亥寅巳申亥寅巳申亥".charAt(yuet_kin.indexOf(fcol[3]));
  //out['奸私']   = "寅巳申亥寅巳申亥寅巳申亥".charAt(yuet_kin.indexOf(fcol[3]));
  out['天械']   = "辰未戌丑辰未戌丑辰未戌丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['天刑']   = "寅辰午申戌子寅辰午申戌子".charAt(yuet_kin.indexOf(fcol[3]));
  out['怪煞']   = "卯巳未酉亥丑卯巳未酉亥丑".charAt(yuet_kin.indexOf(fcol[3]));
  out['獸煞']   = "戌子寅辰午申戌子寅辰午申".charAt(yuet_kin.indexOf(fcol[3]));
  out['聖心']   = "亥巳子午丑未寅申卯酉辰戌".charAt(yuet_kin.indexOf(fcol[3]));
  out['玉宇']   = "卯酉辰戌巳亥午子未丑申寅".charAt(yuet_kin.indexOf(fcol[3]));
  out['金堂']   = "辰戌巳亥午子未丑申寅酉卯".charAt(yuet_kin.indexOf(fcol[3]));
  out['罪至']   = "午子未丑申寅酉卯戌辰亥巳".charAt(yuet_kin.indexOf(fcol[3]));
  out['恩赦']   = "戌丑辰未酉卯子午寅巳申亥".charAt(yuet_kin.indexOf(fcol[3]));
  // 日煞 - 日干
  out['日德']   = "寅申巳亥巳寅申巳亥巳".charAt(yat_gon.indexOf(fcol[4]));
  out['日祿']   = "寅卯巳午巳午申酉亥子".charAt(yat_gon.indexOf(fcol[4]));
  out['日墓']   = "未戌戌丑戌丑丑辰辰未".charAt(yat_gon.indexOf(fcol[4]));
  out['日解']   = "亥申未丑酉亥申未丑酉".charAt(yat_gon.indexOf(fcol[4]));
  out['飛符']   = "巳辰卯寅丑午未申酉戌".charAt(yat_gon.indexOf(fcol[4]));
  out['羊刃']   = "卯辰午未午未酉戌子丑".charAt(yat_gon.indexOf(fcol[4]));
  out['飛刃']   = "酉戌子丑子丑卯辰午未".charAt(yat_gon.indexOf(fcol[4]));
  out['日盜']   = "子亥卯申巳子亥卯申巳".charAt(yat_gon.indexOf(fcol[4]));
  out['日奸']   = "亥酉辰申巳亥酉辰申巳".charAt(yat_gon.indexOf(fcol[4]));
  out['日淫']   = "午午未未戌戌寅寅巳巳".charAt(yat_gon.indexOf(fcol[4]));
  out['遊都']   = "丑子寅巳申丑子寅巳申".charAt(yat_gon.indexOf(fcol[4]));
  out['魯都']   = "未午申亥寅未午申亥寅".charAt(yat_gon.indexOf(fcol[4]));
  out['日賊']   = "辰午申亥寅辰午申亥寅".charAt(yat_gon.indexOf(fcol[4]));
  out['日醫']   = "卯亥丑未巳卯亥丑未巳".charAt(yat_gon.indexOf(fcol[4]));
  out['賢貴']   = "丑申寅寅午丑申寅寅午".charAt(yat_gon.indexOf(fcol[4]));
  out['文星']   = "亥亥寅寅午午巳巳申申".charAt(yat_gon.indexOf(fcol[4]));
  out['干奇']   = "午巳辰卯寅丑未申酉戌".charAt(yat_gon.indexOf(fcol[4]));
  out['大煞']   = "亥亥未未戌戌寅寅巳巳".charAt(yat_gon.indexOf(fcol[4]));
  out['福星']   = "子丑子子未未丑丑巳巳".charAt(yat_gon.indexOf(fcol[4]));
  out['進神1']  = "子子子子子卯卯卯卯卯".charAt(yat_gon.indexOf(fcol[4]));
  out['進神2']  = "午午午午午酉酉酉酉酉".charAt(yat_gon.indexOf(fcol[4]));
  out['退神1']  = "丑丑丑丑丑辰辰辰辰辰".charAt(yat_gon.indexOf(fcol[4]));
  out['退神2']  = "未未未未未戌戌戌戌戌".charAt(yat_gon.indexOf(fcol[4]));
  // 日支神煞表
  out['支德']  = "巳午未申酉戌亥子丑寅卯辰".charAt(yat_ji.indexOf(fcol[5]));
  out['支儀']  = "午巳辰卯寅丑未申酉戌亥子".charAt(yat_ji.indexOf(fcol[5]));
  out['支刑']  = "卯未申子辰寅午戌巳酉丑亥".charAt(yat_ji.indexOf(fcol[5]));
  out['支沖']  = "午未申酉戌亥子丑寅卯辰巳".charAt(yat_ji.indexOf(fcol[5]));
  out['支破']  = "酉辰亥午丑申卯戌巳子未寅".charAt(yat_ji.indexOf(fcol[5]));
  out['支害']  = "未午巳辰卯寅丑子亥戌酉申".charAt(yat_ji.indexOf(fcol[5]));
  out['支墓']  = "辰辰未未辰戌戌辰丑丑辰辰".charAt(yat_ji.indexOf(fcol[5]));
  out['支鬼1']  = "辰卯申酉寅亥子卯午巳寅丑".charAt(yat_ji.indexOf(fcol[5]));
  out['支鬼2']  = "戌卯申酉寅亥子卯午巳寅戌".charAt(yat_ji.indexOf(fcol[5]));
  out['破碎']  = "巳丑酉巳丑酉巳丑酉巳丑酉".charAt(yat_ji.indexOf(fcol[5]));
  out['死神']  = "卯辰巳午未申酉戌亥子丑寅".charAt(yat_ji.indexOf(fcol[5]));
  out['病符']  = "亥子丑寅卯辰巳午未申酉戌".charAt(yat_ji.indexOf(fcol[5]));
  out['勾神']  = "卯戌巳子未寅酉辰亥午丑申".charAt(yat_ji.indexOf(fcol[5]));
  out['絞神']  = "酉辰亥午丑申卯戌巳子未寅".charAt(yat_ji.indexOf(fcol[5]));
  out['驛馬']  = "寅亥申巳寅亥申巳寅亥申巳".charAt(yat_ji.indexOf(fcol[5]));
  out['華蓋']  = "辰丑戌未辰丑戌未辰丑戌未".charAt(yat_ji.indexOf(fcol[5]));
  out['劫煞']  = "巳寅亥申巳寅亥申巳寅亥申".charAt(yat_ji.indexOf(fcol[5]));
  out['災煞']  = "午卯子酉午卯子酉午卯子酉".charAt(yat_ji.indexOf(fcol[5]));
  out['咸池']  = "酉午卯子酉午卯子酉午卯子".charAt(yat_ji.indexOf(fcol[5]));
  out['雷電']  = "辰辰未未戌戌丑丑寅寅卯卯".charAt(yat_ji.indexOf(fcol[5]));
  out['晴朗']  = "午未申酉戌亥子丑寅卯辰巳".charAt(yat_ji.indexOf(fcol[5]));
  var _out = new Array;
  for(var i = 0; i < 12; i++) _out[yat_ji[i]] = new Array;
  for(var o in out) {
    if(out[o] == '　') continue;
    try {
      _out[out[o]].push(o.substr(0,2));
    } catch(e) {
      console.log(e,'_god_effect',o);
    }
  }
  return _out;
}
/** 神煞計算 - 輸出表 **/
function god_effect_output(yy,mm,dd,hh,ii,ss) {
  var jiqi = new JiQi();
  //var d = new Date();
  //var jtoday = date_to_julian_day2(d.getFullYear(),d.getMonth()+1,d.getDate()) + 
  //  date_to_julian_time(d.getHours(), d.getMinutes(), d.getSeconds());
  var jtoday = date_to_julian_day2(yy,mm,dd)+
  date_to_julian_time(hh,ii,ss);
  var jqTime = new Array;
  jiqi.GetPureJQsinceSpring2(yy,0,0,0,jqTime);  // 計算當年節氣(以立春日為新一年)
  if(jtoday < jqTime[0]) {
    jiqi.GetPureJQsinceSpring2(yy-1,0,0,0,jqTime);  // 計算上一年節氣(以立春日為新一年)
  }
  var fcol = jiqi.GetGZ(yy,mm,dd,hh,ii,ss); // 排四柱
  document.write("<pre>");
  var _out = new Array();
  for(var i = 0; i < 12; i++) _out["子丑寅卯辰巳午未申酉戌亥".charAt(i)] = new Array();
  var _ge = _god_effect_year(fcol);
  for(var i in _ge) _out[i] = _out[i].concat(_ge[i]);
  //var _ge = _god_effect_month_gan(fcol);
  //for(var i in _ge) _out[i] = _out[i].concat(_ge[i]);
  var _ge = _god_effect_month_ji(fcol);
  for(var i in _ge) _out[i] = _out[i].concat(_ge[i]);
  //var _ge = _god_effect_day_gan(fcol);
  //for(var i in _ge) _out[i] = _out[i].concat(_ge[i]);
  var _ge = _god_effect_day_ji(fcol);
  for(var i in _ge) _out[i] = _out[i].concat(_ge[i]);
  var _ge = _god_effect(fcol);
  for(var i in _ge) _out[i] = _out[i].concat(_ge[i]);
  //
  for(var i in _out) {
    var _counter = 1;
    document.write(i,"\r\n");
    for(var j in _out[i]) {
      document.write(_out[i][j].slice(0,2));
      if(_counter % 5 == 0)
        document.write("\r\n");
      else
        document.write("　");
      _counter++;
    }
    document.write("\r\n");
    document.write("\r\n");
  }
  document.write("</pre>");
 }
/**
 *輸出
 */
//test();
//var jtoday = date_to_julian_day2(d.getFullYear(),d.getMonth()+1,d.getDate()) + 
//    date_to_julian_time(d.getHours(), d.getMinutes(), d.getSeconds())
function _gui_cal() {
  // redirect document write
  var _buffer = "";
  var o_doc_write = document.write;
  document.write = function() {
    var args = Array.prototype.slice.call(arguments);
    _buffer += args.join("");
  };
  //
  var d = new Date();
  var g = 1;
  BaZi(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),g);
  $("#display_bazi").html(_buffer); _buffer = "";
  //LuiYin(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds());
  QiMen(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds());
  $("#display_qimen").html(_buffer); _buffer = "";
  astro_firdaria(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds());
  $("#display_firdaria").html(_buffer); _buffer = "";
  god_effect_output(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds());
  $("#display_god_effect").html(_buffer); _buffer = "";
  //
  $("#display").html("");
  $("#display").html($("#display_bazi").html());
  _buffer = "";
  
  document.write = o_doc_write;
};
function _gui_cal2() {
  // redirect document write
  var _buffer = "";
  var o_doc_write = document.write;
  document.write = function() {
    var args = Array.prototype.slice.call(arguments);
    _buffer += args.join("");
  };
  //
  var d = new Date();
  var g = 1;
  var id = prompt('d');
  if(id) {
    if(!gui_check_input_date(id)) {
      alert('error format');
      return;
    }
    // input date
    d = new Date(
      (id.substr(0,4)), 
      (id.substr(4,2)-1), 
      (id.substr(6,2)), 
      (id.substr(8,2)), 
      (id.substr(10,2)));
    if(!d) {
      alert('format error');return;
    }
    g = id.substr(12,1);
  } else {
    return;
  }
  console.log(d);
  BaZi(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),g);
  $("#display_bazi").html(_buffer); _buffer = "";
  //LuiYin(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds());
  QiMen(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds());
  $("#display_qimen").html(_buffer); _buffer = "";
  astro_firdaria(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds());
  $("#display_firdaria").html(_buffer); _buffer = "";
  god_effect_output(d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds());
  $("#display_god_effect").html(_buffer); _buffer = "";
  //
  $("#display").html("");
  $("#display").html($("#display_bazi").html());
  _buffer = "";
  document.write = o_doc_write;
};
function gui_check_input_date(id) {
  "use strict";
  var patt1=/^[0-9]{4}[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}[01]$/i;
  if(!id.match(patt1)) {
    return false;
  }
  var daysInMonth = [0,31,28,31,30,31,30,31,31,30,31,30,31];
  // If evenly divisible by 4 and not evenly divisible by 100,
  // or is evenly divisible by 400, then a leap year
  var y = (id.substr(0,4))*1;
  var m = (id.substr(4,2))*1;
  var d = (id.substr(6,2))*1;
  var h = (id.substr(8,2))*1;
  var i = (id.substr(10,2))*1;
  var s = (id.substr(12,2))*1;
  //console.log(y,m,d,h,i,s);
  if ( (!(y % 4) && y % 100) || !(y % 400)) {
    daysInMonth[2] = 29;
  }
  if(m < 1 || m > 12) return false;
  if(d < 1 || d > daysInMonth[m]) return false;
  if(h < 0 || h > 23) return false;
  if(i < 0 || i > 59) return false;
  if(s < 0 || s > 59) return false;
  return true;
}
function gui_change_text_size() {
  this.size = 4;
  this.inc = function() {
    this.size += 1;
    $("#display").css("font-size",this.size+"mm");
  }
  this.dec = function() {
    if(this.size <= 2) return;
    this.size -= 1;
    $("#display").css("font-size",this.size+"mm");
  }
}
function gui_show_hide_menu() {
  this.isShow = false;
  this.switchOnOff = function() {
    if(this.isShow) {
      $("#nav2").css("display","none");
      this.isShow = false;
    } else {
      $("#nav2").css("display","block");
      this.isShow = true;
    }
  }
}
var _gui_display_text_resize =  new gui_change_text_size();
var _gui_show_hide_menu = new gui_show_hide_menu();
$(document).ready(_gui_cal);
</script>
<style type="text/css">
body { margin-top: 5mm;}
input { border: 2pt solid #CCC; margin: 5pt; padding: 5pt }
#nav {
  position:fixed;right: 0; top: 0;background-color: #FCC;
  font-size: 1cm;
  opacity:0.8;
  overflow: hidden;
  /** disable select **/
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#logo {
  background-color: #FCC;
  font-size: 1cm;
  overflow: hidden;
}
div.temp {
  overflow: hidden;
  width: 1pt;
  height: 1pt;
  display: none;
}
.nav2 {
  -webkit-writing-mode:vertical-rl; writing-mode: tb-rl;
}
</style>
</head>
<body style="background-color:#000000">
  <div id="display" style="font-size:4mm;color:#FFFFFF;background-color:#000000;"></div>
  <div id="nav">
    <div onclick="_gui_show_hide_menu.switchOnOff()">佛</div>
    <div id="nav2" style="display:none">
      <div id="logo" onclick="_gui_cal2()">輸入</div>
      <div id="logo" onclick="_gui_cal()" >當下</div>
      <div onclick="$('#display').html($('#display_bazi').html())"    >八字</div>
      <div onclick="$('#display').html($('#display_qimen').html())"   >奇門</div>
      <div onclick="$('#display').html($('#display_firdaria').html())">法達</div>
      <div onclick="$('#display').html($('#display_god_effect').html())">神煞</div>
      <div onclick="_gui_display_text_resize.inc()">字＋</div>
      <div onclick="_gui_display_text_resize.dec()">減－</div>
    </div>
  </div>
  <div id="display_bazi" class="temp"></div>
  <div id="display_qimen" class="temp"></div>
  <div id="display_firdaria" class="temp"></div>
  <div id="display_god_effect" class="temp"></div>
  
</body>
</html>
